Difficulty getting or keeping an erection happens when blood flow to the penis is restricted, nerve signals are disrupted, hormones are off balance, or stress and anxiety interfere with arousal. It’s one of the most common sexual health problems men experience, affecting roughly 16% of men between ages 40 and 60, and it shows up in younger men more often than most people realize. The cause is almost always identifiable and treatable.
How Erections Work
An erection is fundamentally a blood flow event. When you’re aroused, nerve signals trigger the release of nitric oxide, a small signaling molecule inside the blood vessels of the penis. Nitric oxide causes the smooth muscle tissue in the shaft to relax, which allows blood to rush in and fill two sponge-like chambers. As those chambers expand, they press against the veins that normally drain blood out, trapping it inside. That’s what creates firmness.
Anything that disrupts this chain, from the initial nerve signal to nitric oxide production to blood vessel health to the physical structure of the tissue, can make it difficult or impossible to get hard.
Blood Vessel Problems Are the Most Common Cause
The arteries that supply the penis are only 1 to 2 millimeters wide, making them some of the smallest arteries in the body. That means they’re among the first to clog or stiffen when cardiovascular health declines. High blood pressure, high cholesterol, diabetes, and smoking all damage blood vessel walls and reduce blood flow over time.
This is why erection problems often show up 2 to 5 years before a heart attack or other major cardiac event. The same plaque buildup that eventually blocks coronary arteries hits penile arteries first because they’re so small. In many cases, difficulty getting hard is the earliest and only visible symptom of cardiovascular disease. If you’re in your 40s or older and erections have gradually gotten weaker, this is worth taking seriously for reasons beyond your sex life.
Psychological Causes Feel Different
Stress, anxiety, depression, relationship problems, and performance pressure can all shut down erections. Your brain is the starting point of the entire arousal process, so when it’s occupied with worry or flooded with stress hormones, the signal to release nitric oxide never fires properly.
There’s a useful way to tell whether the cause is psychological or physical. If you still get erections when you wake up in the morning or when you masturbate, the physical plumbing is likely working fine. The issue is situational, tied to a specific context, partner dynamic, or mental state. If you rarely or never get erections under any circumstance, including during sleep, that points more toward a physical cause like vascular disease, nerve damage, or hormonal issues. Many men have a combination of both.
Low Testosterone
Testosterone plays a supporting role in erections by driving libido and helping maintain the tissues involved in arousal. The American Urological Association defines low testosterone as a total level below 300 ng/dL, measured through a morning blood draw on two separate occasions. If your levels fall below that threshold, you may notice reduced sex drive alongside erection difficulties.
Low testosterone alone doesn’t always cause erection problems, but it makes them more likely and can make other causes harder to overcome. It’s more common in men over 40, but can occur at any age due to obesity, chronic illness, sleep disorders, or certain medications. Weight loss and improved sleep can raise testosterone levels naturally in many cases.
Medications That Interfere
A surprising number of common medications can cause or worsen erection problems. Antidepressants, particularly SSRIs, are well-known culprits. Blood pressure medications, especially older types like beta-blockers, can reduce blood flow to the penis. Antihistamines, opioid painkillers, and some prostate medications also affect erectile function. If your erection problems started around the same time you began a new medication, that connection is worth exploring with whoever prescribed it.
What a Doctor Will Actually Check
The diagnostic process is straightforward and not as uncomfortable as you might expect. It typically starts with a conversation about your medical history, sexual history, and what specifically is happening (or not happening) with your erections. A physical exam checks the penis, testicles, and nerve response.
Blood tests look for the most common underlying causes: blood sugar levels (to screen for diabetes), cholesterol, testosterone, and markers of heart disease. A urine test can flag diabetes or other metabolic problems. In some cases, an ultrasound of the penile blood vessels measures blood flow directly. This uses a handheld device pressed against the skin, not an invasive procedure.
How ED Medications Work
The most widely prescribed treatments for erection problems are PDE5 inhibitors, a class of drugs that includes sildenafil (Viagra) and tadalafil (Cialis). These don’t create an erection out of nowhere. They amplify the effect of nitric oxide by preventing the breakdown of a chemical that keeps blood vessels in the penis relaxed. You still need arousal for them to work.
Sildenafil is typically taken 30 to 60 minutes before sex and lasts around 4 to 6 hours. Tadalafil lasts significantly longer, up to 36 hours, which is why some men prefer it for more spontaneous timing. Starting doses vary, and a doctor will usually begin with a moderate dose and adjust based on how well it works and whether you experience side effects like headaches, flushing, or nasal congestion.
One critical safety note: these medications cannot be combined with nitrate drugs, which are commonly prescribed for chest pain and heart conditions. The combination can cause a dangerous drop in blood pressure. If you take any form of nitroglycerin or similar heart medication, this needs to be discussed before starting an ED drug.
Exercise Can Be as Effective as Medication
A review of 11 clinical trials involving over 1,000 men found that regular aerobic exercise, 30 to 60 minutes per session, three to five times per week, improved erection quality as much as medication in men with mild to moderate difficulties. Walking, running, and cycling were the most common activities studied.
This makes sense given how central blood flow is to the process. Aerobic exercise improves cardiovascular health, lowers blood pressure, reduces inflammation in blood vessel walls, and boosts nitric oxide production. It also raises testosterone, reduces stress hormones, and improves sleep quality, addressing several ED causes simultaneously. For men whose erection problems stem from early vascular decline or a sedentary lifestyle, consistent exercise is one of the most effective interventions available.
Other Lifestyle Factors That Matter
Excess body weight, particularly around the midsection, is strongly linked to erection problems. Fat tissue converts testosterone into estrogen, lowers nitric oxide availability, and promotes the kind of chronic inflammation that damages blood vessels. Losing even a moderate amount of weight can meaningfully improve erectile function.
Smoking directly damages the lining of blood vessels and accelerates atherosclerosis. Heavy alcohol use suppresses the nervous system and lowers testosterone. Poor sleep, especially untreated sleep apnea, tanks testosterone levels and increases cardiovascular risk. Each of these factors is individually capable of causing erection difficulties, and most men dealing with this issue have more than one at play.
Porn-related concerns come up frequently in online discussions. While heavy pornography use can create unrealistic expectations and make it harder to respond to real-life arousal for some men, this is a behavioral pattern rather than a medical condition, and it tends to resolve with changes in habits.

