Impotence and sterility are both problems that can affect a man’s sexual health and ability to have children, but in different ways.

Impotence, otherwise known as erectile dysfunction (ED), refers to trouble getting or maintaining an erection. This can make it difficult or impossible to have intercourse. Sterility, also called infertility, refers to an inability to produce or release sperm.

Here’s a look at the two conditions, what causes them, and how they are treated.

Up to 30 million men in America experience ED. It becomes more common as you get older. The Cleveland Clinic reports that 1 in 10 adult males will end up with ED issues in the long term.

For a man to achieve a full erection, several different organs, including those within the nervous system, muscles, and blood vessels, need to work in a coordinated fashion. Men can have trouble getting an erection if any one of these systems are compromised.

Some major causes for ED include:

ED can also be related to surgery or radiation to treat prostate cancer or treatments for an enlarged prostate (benign prostatic hypertrophy, or BPH). ED can also be caused by emotional issues such as:

  • stress
  • guilt
  • anxiety
  • low self-esteem

If you’ve been trying to get your partner pregnant for at least a year without success, you may be dealing with infertility. The problem can stem from either partner, or both combined. About one-third of the time, the issue is with the man only.

A man’s infertility can be due to problems producing or releasing sperm. Some causes for infertility include:

The cause for infertility may be unclear. This is because men dealing with infertility often have other symptoms, such as problems with sexual function, reduced desire, swelling in the scrotum, and trouble ejaculating.

If you’re having trouble getting an erection, see your doctor or urologist. Although talking about impotence may be difficult, it’s important to get treated. Letting the problem persist untreated can put a strain on your relationship as well as prevent you from having children.

First, your doctor will perform a physical exam. Then your doctor may order lab tests (such as a testosterone level, HbA1c, or fasting lipid panel) to look for diseases such as diabetes mellitus, heart disease, or hormonal problems that could be causing your erection issues.

Based on your exam and laboratory results, your doctor will recommend a treatment plan.

Sometimes, making a few changes to your lifestyle is all it takes, including things like:

  • exercising regularly
  • losing weight
  • quitting tobacco smoking
  • cutting back on alcohol

All of these lifestyle changes can help treat your condition.

If those methods don’t work, your doctor might prescribe a medication (called a phosphodiesterase-5-inhibitor) that increases blood flow to the penis to produce an erection. These include:

  • sildenafil (Viagra)
  • tadalafil (Cialis)
  • vardenafil (Levitra, Staxyn)

All of these medications carry risks, especially if you’ve had heart failure, have other heart disease, take nitrate drugs for heart disease, or have low blood pressure. Talk to your doctor to see if this type of medication is the best option for you.

Another medication used to treat erectile dysfunction is alprostadil (Caverject Impulse, Edex, Muse), which is Prostaglandin E1 therapy. This medication is either self-injected or inserted as a suppository into the penis. It produces an erection that lasts for up to an hour.

If medication therapy isn’t right for you, penis pumps or implants might help.

When the problem is emotional, seeing a counselor can help you deal with the issues that are making it difficult for you to achieve an erection. Your partner may take part in the therapy sessions.

You should see a doctor if you’ve been trying to conceive for at least a year with no luck. Some of the tests used to diagnose infertility in men include:

Your treatment will depend on what’s causing the problem. There are several treatment options, including:

  • hormone replacement therapy
  • surgery to repair a physical problem with the testicles
  • treatments to treat an infection or disease that’s causing infertility

Also, in vitro fertilization or artificial insemination (in which sperm are injected right into the cervix or uterus) are procedures used to achieve conception when infertility is an issue.

Both impotence and infertility can be hard to discuss, even with your doctor. But being open about your condition can help improve your sex life and ensure you get the correct treatment.