Maintaining an erection depends on steady blood flow into the penis and keeping it trapped there. That process requires relaxed blood vessels, healthy nerve signaling, and a calm mental state working together at the same time. When any one of those breaks down, erections become unreliable. The good news: most of the factors involved are things you can directly influence.
How Erections Actually Work
An erection starts when nerves release nitric oxide into penile tissue. Nitric oxide triggers a chain reaction that relaxes the smooth muscle inside the two sponge-like chambers (the corpora cavernosa) of the penis. As those muscles relax, blood rushes in and fills the chambers. At the same time, the expanding tissue compresses the veins that would normally drain blood away, trapping it inside. That’s what keeps you hard.
Anything that interferes with nitric oxide production, blood vessel flexibility, or venous trapping can make erections weaker or shorter-lived. This is why erectile difficulties are so closely tied to cardiovascular health: the same blood vessel problems that raise heart disease risk also starve the penis of the blood flow it needs.
How Common Erection Problems Are
If you’re dealing with this, you’re far from alone. Among men aged 40 to 60, about 16% report erectile difficulties. That number jumps to 57% in men between 60 and 80. Data on younger men is harder to pin down, but researchers consistently find that men in their 20s and 30s experience it too, often driven more by psychological factors than physical ones.
Why Anxiety Makes It Harder to Stay Hard
Performance anxiety is one of the most common reasons younger men lose erections during sex. The mechanism is straightforward: anxiety activates your fight-or-flight response, flooding your system with adrenaline and noradrenaline. Those stress hormones constrict blood vessels in the penis, directly reducing the blood flow you need. Stress also suppresses nitric oxide release in penile tissue, the very molecule responsible for keeping smooth muscle relaxed and blood flowing in.
This creates a frustrating cycle. You lose your erection once, which makes you anxious the next time, which makes it more likely to happen again. Breaking the cycle usually means addressing the anxiety itself rather than just the erection. Cognitive behavioral therapy has strong evidence behind it for sexual performance anxiety. Mindfulness during sex, focusing on physical sensation rather than monitoring your erection, can also interrupt the adrenaline response. For some men, using medication temporarily (more on that below) helps rebuild confidence enough to break the pattern.
Exercise That Improves Erection Quality
Aerobic exercise is one of the most effective things you can do. It improves the health of blood vessel linings, boosts nitric oxide production, lowers blood pressure, and reduces stress hormones. Clinical trials on men with erectile difficulties typically use sessions of 30 to 60 minutes, three to five times per week. Brisk walking, cycling, swimming, and jogging all qualify. The key is consistency over weeks and months rather than intensity on any single day.
Pelvic floor exercises (Kegels) target a different part of the problem. The muscles at the base of your pelvis help compress the veins that trap blood inside the penis. Strengthening them can improve both erection firmness and your ability to maintain it. To find the right muscles, try stopping your urine stream midflow or tightening the muscles you’d use to hold in gas. Once you’ve identified them, squeeze for three seconds, relax for three seconds, and repeat. Aim for three sets of 10 to 15 repetitions each day. Most men notice results within a few weeks to a few months of consistent practice. The important thing is isolating those muscles: don’t flex your abs, thighs, or glutes, and keep breathing normally.
What You Eat Affects Blood Flow
A Mediterranean-style diet, heavy on vegetables, fruits, whole grains, fish, nuts, and olive oil, consistently shows up in research on erectile function. The connection is vascular health. Extra virgin olive oil contains compounds that stimulate nitric oxide production while reducing chemicals that constrict blood vessels. Red wine polyphenols (in moderate amounts) have a similar effect, boosting the enzyme that produces nitric oxide in blood vessel walls.
More broadly, foods rich in flavonoids (berries, citrus fruits, dark chocolate, red and purple grapes) and dietary nitrates (beets, leafy greens like spinach and arugula) support the nitric oxide pathway your erections depend on. You don’t need to overhaul your diet overnight. Shifting toward more whole foods and fewer processed ones makes a measurable difference over time.
Sleep Matters More Than You Think
Poor sleep quietly undermines erection quality in several ways. Testosterone production peaks during deep sleep, so chronically short or fragmented sleep lowers the hormone levels that support sexual function. Sleep apnea, a condition where your airway repeatedly collapses during sleep, is especially damaging: between 50% and 80% of men with sleep apnea also have erectile dysfunction. The repeated oxygen drops damage blood vessel linings and reduce nitric oxide availability.
If you snore heavily, wake up gasping, or feel exhausted despite spending enough hours in bed, sleep apnea is worth investigating. Treating it with a CPAP device (a mask that keeps your airway open at night) has been shown to significantly improve erection firmness and the number of nocturnal erections. Even without apnea, prioritizing seven to nine hours of quality sleep supports the hormonal and vascular systems your erections rely on.
Supplements: What the Evidence Says
L-arginine is the supplement with the most research behind it for erectile function. It’s the raw material your body uses to produce nitric oxide. A meta-analysis found that doses between 1,500 and 5,000 mg per day significantly improved erectile function compared to placebo. Side effects were mild and uncommon (about 8% of users versus 2% on placebo), with no severe reactions reported. L-citrulline, a related amino acid, converts to arginine in the body and may be better absorbed.
These supplements work best for men whose erection issues are mild or partly related to blood flow. They won’t override severe vascular disease or strong psychological factors. And they’re far less potent than prescription medications, so set expectations accordingly.
When Medication Helps
Prescription PDE5 inhibitors work by blocking the enzyme that breaks down the erection-maintaining chemical (cGMP) in penile tissue. This amplifies your body’s natural response to arousal, making it easier to get and stay hard. The three main options differ in timing and duration:
- Sildenafil (Viagra): Take about an hour before sex. Works for 4 to 5 hours. The most widely studied option.
- Tadalafil (Cialis): Can work as quickly as 30 minutes, but peaks around 2 hours. Lasts up to 36 hours, which makes timing less of an issue and reduces the “planned” feeling of taking a pill.
- Vardenafil (Levitra): Similar profile to sildenafil, peaking around an hour and lasting 4 to 5 hours.
These medications require sexual arousal to work. They don’t create an erection on their own. They’re effective for the majority of men who try them, but they treat the symptom rather than the underlying cause. For many men, combining medication with exercise, diet changes, and stress management produces better long-term results than relying on pills alone.
Other Factors Worth Addressing
Smoking directly damages the blood vessel linings that produce nitric oxide. Even in younger men, smoking is one of the strongest predictors of erection problems. Quitting leads to measurable improvements in vascular function within weeks.
Alcohol in small amounts can reduce anxiety and may slightly help in the moment, but more than a couple of drinks suppresses the nervous system signals needed for erection. Heavy drinking over time lowers testosterone and damages nerves.
Excess body fat, particularly around the midsection, increases inflammation and disrupts hormone balance. Losing even 5% to 10% of body weight can noticeably improve erectile function in overweight men. This ties back to exercise and diet: the same habits that protect your heart protect your erections.

