Erectile dysfunction at 40 is more common than most men realize, and in the majority of cases, it’s fixable. The Massachusetts Male Aging Study found that roughly 39% of men have some degree of erectile difficulty by age 40. That includes mild, occasional problems, not just a complete inability to get an erection. The good news: because ED at this age often traces back to reversible causes, the right combination of lifestyle changes and medical treatment can produce real improvement, sometimes within months.
Why ED Happens at 40
Erections depend on healthy blood flow. When you’re sexually aroused, blood vessels in the penis need to relax and widen to let blood rush in. That process requires the inner lining of your blood vessels (the endothelium) to function properly. By your 40s, years of high blood pressure, elevated cholesterol, excess weight, or smoking can quietly damage that lining, making it harder for those vessels to dilate on demand.
This same process, called endothelial dysfunction, is the earliest stage of atherosclerosis. The arteries supplying the penis are smaller than the ones feeding the heart and brain, so they tend to show damage first. That’s why the American Heart Association considers ED a potential early warning sign: heart attacks and strokes can follow within 3 to 5 years in men with underlying vascular disease. This doesn’t mean ED guarantees a cardiac event, but it does mean the symptom deserves medical attention beyond just fixing erections.
Other physical causes at 40 include uncontrolled blood sugar (which damages both nerves and blood vessels over time), low testosterone, medication side effects (especially from blood pressure drugs and antidepressants), and obesity. And physical causes don’t act alone. Stress, performance anxiety, depression, and relationship tension all play a role. The brain initiates the entire arousal cascade, so mental health problems can cause ED on their own or amplify a physical problem that might otherwise be minor.
Get the Right Tests First
Before trying to fix the problem, you need to know what’s driving it. The American Urological Association recommends a thorough medical and sexual history, a physical exam, and targeted bloodwork. At minimum, your doctor should check a morning total testosterone level. Normal range for adult men is 193 to 824 ng/dL, though symptoms of low testosterone can appear even when levels fall in the lower end of “normal.” Depending on your risk factors, your doctor may also check fasting blood sugar, cholesterol, and thyroid function.
A validated questionnaire (your doctor may hand you a short form to fill out) helps quantify the severity of your ED, from mild to severe. This matters because treatment strategies differ. Mild ED often responds to lifestyle changes alone, while moderate or severe cases typically need medication or other interventions alongside those changes.
Exercise: The Most Effective Lifestyle Fix
Aerobic exercise is the single most impactful non-medical change you can make. A meta-analysis of randomized controlled trials found that 30 to 60 minutes of moderate-to-vigorous activity, 3 to 5 times per week, improved erectile function over a median period of 6 months. The benefit was clearest in men with mild ED, where the improvement crossed the threshold considered clinically meaningful.
Exercise works through multiple channels. It improves blood vessel function, lowers blood pressure, reduces inflammation, boosts testosterone, and helps with weight loss. In a study of 250 middle-aged men with high blood pressure and ED, those with greater exercise capacity (able to sustain higher intensity on a treadmill test) had better erectile performance, higher testosterone, and less arterial stiffness. The type of exercise matters less than consistency. Running, cycling, swimming, brisk walking, rowing: pick what you’ll actually do three to five days a week and stick with it for several months before judging results.
Diet, Weight, and Metabolic Health
What you eat directly affects the blood vessels that make erections possible. The Mediterranean diet, built around vegetables, fruits, whole grains, olive oil, fish, and nuts, has the strongest evidence. In that same study of middle-aged men with hypertension, those who scored highest on Mediterranean diet adherence had significantly better erectile performance, higher testosterone, and healthier blood flow through their coronary arteries. These men also had less arterial stiffness, a marker of vascular aging.
If you’re carrying excess weight, losing even a moderate amount can help. Fat tissue, particularly abdominal fat, converts testosterone to estrogen and promotes chronic inflammation, both of which impair erectile function. Men with diabetes face an especially steep challenge: persistently high blood sugar damages the small nerves and blood vessels the penis relies on. Getting blood sugar under control won’t reverse existing nerve damage, but it slows further progression and improves vascular function.
Quit Smoking
Smoking is one of the most direct causes of vascular ED. Nicotine constricts blood vessels, carbon monoxide reduces oxygen delivery, and the chemicals in cigarette smoke accelerate damage to the endothelial lining. For men with mild ED, quitting smoking can lead to noticeable improvement within several months. The longer you’ve smoked and the more severe the damage, the longer recovery takes, but vascular function begins improving within weeks of stopping.
Reduce Alcohol and Improve Sleep
Heavy drinking suppresses testosterone production and impairs nerve signaling. One or two drinks occasionally is unlikely to cause problems, but regular heavy use is a well-established contributor. Sleep matters too. Testosterone production peaks during deep sleep, and men who consistently sleep fewer than six hours tend to have lower levels. Treating sleep apnea, which is common in overweight men in their 40s, can improve both testosterone and erectile function.
Address the Psychological Side
Performance anxiety creates a vicious cycle: one failed erection leads to worry about the next attempt, which triggers a stress response that makes failure more likely. This pattern is extremely common at 40, especially when a man who never had problems suddenly experiences difficulty and panics. Work stress, financial pressure, relationship conflict, and depression all feed into this loop.
Therapy with a psychologist or sex therapist is effective for psychologically driven ED and helpful even when the primary cause is physical. Cognitive behavioral therapy can break the anxiety cycle. Couples therapy addresses relationship dynamics that may be contributing. Many men find that once medication restores reliable erections for a period, the performance anxiety fades on its own, and some are eventually able to stop the medication.
Medication Options
PDE5 inhibitors are the first-line medical treatment and work for roughly 70% of men. These drugs enhance your body’s natural arousal response by helping blood vessels in the penis relax more fully. They don’t create arousal on their own; you still need stimulation.
The three most commonly prescribed options differ mainly in timing. Sildenafil and vardenafil are taken about 60 minutes before sex and last for several hours. Tadalafil can be taken as needed or as a low daily dose, and its effects last up to 36 hours, which many men prefer because it removes the need to plan around a pill. Your doctor will typically start at a moderate dose and adjust based on response and side effects, which can include headache, facial flushing, and nasal congestion.
These medications are less effective in men with severe nerve damage (such as from long-standing diabetes) or after certain prostate surgeries. If PDE5 inhibitors don’t work, other options include vacuum erection devices, penile injections, and surgical implants, though most men in their 40s respond well to oral medication combined with lifestyle changes.
Realistic Timeline for Improvement
How quickly things improve depends on the cause and the approach. Medication works within the first dose for most men, providing immediate relief while longer-term fixes take hold. Lifestyle changes operate on a slower timeline. Exercise-related improvements in erectile function typically emerge over 3 to 6 months of consistent training. Quitting smoking shows benefits within several months for mild cases. Weight loss and dietary changes work gradually as metabolic health improves.
The most effective strategy combines approaches. Start medication if you want faster results, begin a regular exercise program, clean up your diet, address sleep and stress, and quit smoking if applicable. Many men find that after 6 to 12 months of sustained lifestyle improvement, their dependence on medication decreases or they can use a lower dose. At 40, the underlying damage is usually early enough that meaningful reversal is possible, which is exactly why addressing it now rather than later matters so much.

