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), means you have trouble getting or maintaining an erection. This can make it difficult or impossible to have sex. Sterility, or infertility, refers to problems producing or releasing sperm.

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

Up to 30 million men in America struggle with erectile dysfunction. The problem becomes more common as you get older. According to the National Institutes of Health, almost 17 percent of men in their 60s experience trouble getting or maintaining erections. By age 75, nearly half of men will deal with erectile dysfunction.

For a man to achieve a full erection, several different organ systems, including the nerves, muscles, blood vessels, and brain, 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 erectile dysfunction include:

  • blood vessel or heart disease
  • depression or other mood disorders
  • stress (including performance anxiety)
  • diabetes
  • Parkinson’s disease or multiple sclerosis
  • high blood pressure or high cholesterol
  • medications such as antidepressants, antihistamines, or blood pressure drugs
  • nerve damage
  • Peyronie’s disease (scar tissue within the penis)
  • obesity
  • tobacco use
  • alcohol or drug abuse

Erectile dysfunction can also be triggered by surgery or radiation to treat prostate cancer, or treatments for an enlarged prostate. 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.

Infertility in the man can be due to problems producing or releasing sperm. Some causes for infertility include:

  • cancer treatments such as chemotherapy or radiation
  • diseases such as diabetes or cystic fibrosis
  • enlarged veins in the testicles (varicocele)
  • exposure to pesticides and other toxins
  • alcohol abuse
  • use of certain drugs like steroids
  • genetic conditions
  • injury or surgery to the testicles or other organs in the reproductive system
  • mumps or other infections that cause the testicles to swell up
  • sexually transmitted diseases, such as gonorrhea or chlamydia
  • retrograde ejaculation, when the sperm flows back into the bladder instead of through the penis
  • undescended testicles
  • vasectomy

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, or prevent you from having children.

First, your doctor will perform a physical exam. Then your doctor may order lab tests (such as a testosterone test), to look for diseases such as diabetes or 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. Things like:

  • exercising
  • losing weight
  • quitting 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 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 take nitrate drugs for heart disease or have liver or kidney disease. Talk to your doctor to see if they’re the best option for you.

Another medication used to treat erectile dysfunction is alprostadil (Caverject Impulse, Edex, Muse). This medication is either self-injected or inserted as a suppository into the penis. This treatment produces an erection that lasts for about an hour. If medication 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 hard 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:

  • blood tests to check hormone levels
  • genetic screening tests
  • semen analysis (to check sperm counts and motility)
  • ultrasound or biopsy of the testicles

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 cure the infection or the disease that’s causing infertility

Also, in vitro fertilization or artificial insemination (in which sperm are injected right into the woman’s 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.