Maintaining an erection during sex depends on a chain of events involving blood flow, nerve signaling, mental focus, and hormonal balance, and a weak link anywhere in that chain can cause things to falter. The good news is that most of the factors involved are modifiable. The approaches with the strongest evidence behind them include regular aerobic exercise, managing psychological interference like performance anxiety, getting enough sleep, and, when warranted, medication. The less encouraging truth is that there is no single trick that works for everyone, because the reason you lose hardness determines which fix actually helps.
A Quick Look at What Keeps an Erection Going
An erection is fundamentally a blood-pressure event inside a specialized vascular system. It involves three overlapping phases: increased blood flow into the penis through paired arteries, relaxation and expansion of spongy tissue inside the shaft as it fills with blood, and then a trapping mechanism that prevents that blood from draining back out, which is what produces full rigidity.1Urological Science. Penile venous surgery for treating erectile dysfunction: Past, present, and future perspectives with regard to new insights in venous anatomy Anything that reduces arterial inflow, prevents smooth-muscle relaxation, or disrupts the trapping of blood will compromise firmness. That is why erectile difficulties can stem from so many different causes: a cardiovascular issue affects inflow, anxiety affects nerve signaling that triggers relaxation, and structural changes with aging can affect the trapping mechanism. Understanding which part of the chain is weakest for you points you toward the intervention most likely to help.
Your Brain Is Usually the Biggest Variable
If you can get fully hard during masturbation or wake up with strong morning erections but struggle during partnered sex, the issue is almost certainly above the neck. Research consistently finds that men report less sexual impairment during solo masturbation than during sex with a partner across all types of dysfunction, including erection problems.2The Journal of Sexual Medicine. Sexual Response Differs During Partnered Sex and Masturbation in Men with and Without Sexual Dysfunction: Implications for Treatment That gap is strong evidence that the physical hardware works fine and the difficulty is situational.
Performance anxiety is the most common psychological culprit. When you start worrying about whether you will stay hard, your sympathetic nervous system ramps up, and heightened sympathetic activity has been shown to facilitate loss of erection after arousal has already begun.3PubMed. Effects of demand for performance, self-monitoring of arousal, and increased sympathetic nervous system activity on male erectile response This creates a vicious cycle: you notice a slight softening, you panic, the panic triggers a fight-or-flight response, and the erection fades further. Simply knowing that this feedback loop exists can help you interrupt it.
A related pattern is what researchers call “spectatoring,” where you mentally step outside the sexual experience to monitor and evaluate your own performance. A study of over 850 sexually active men found that those with body-related concerns were more likely to spectate, and that spectatoring was in turn linked to greater problems with erection and orgasm.4PubMed. Anxiousness and Distractibility Strengthen Mediated Associations Between Men’s Penis Appearance Concerns, Spectatoring, and Sexual Difficulties: A Preregistered Study More broadly, non-erotic thoughts during sex and the anxiety they produce are associated with poorer sexual functioning for both men and women.5PubMed. Non-erotic thoughts: content and relation to sexual functioning and sexual satisfaction
The practical takeaway here is straightforward: anything that pulls your attention out of the physical sensations of sex and into self-evaluation or worry is working against you. Strategies that keep your focus anchored in what you are feeling, rather than what you are thinking about your performance, address the most common cause of erection loss during sex.
Mindfulness and Therapy for Situational Difficulties
If performance anxiety or spectatoring is the primary problem, mindfulness-based approaches have shown genuine promise. A pilot study specifically targeting men with situational erectile dysfunction found that a mindfulness group therapy program led to meaningful improvements in erectile functioning, overall sexual satisfaction, and the ability to observe one’s experience without judgment.6The Journal of Sexual Medicine. Mindfulness-Based Group Therapy for Men With Situational Erectile Dysfunction: A Mixed-Methods Feasibility Analysis and Pilot Study A separate randomized trial found that adding a mindfulness-based intervention to standard sex therapy produced significantly greater reductions in how much patients were bothered by their sexual problems compared to therapy alone.7PubMed Central. Mindfulness in sex therapy and intimate relationships: a feasibility and randomized controlled pilot study in a cross-diagnostic group
These studies are still relatively small, but the direction is consistent and the logic is sound. Mindfulness trains you to notice anxious thoughts without getting swept up in them, which directly counters the spectatoring pattern. You do not need a formal program to start practicing this. During sex, when you catch yourself drifting into worry, deliberately redirect your attention to a specific physical sensation: temperature, pressure, texture, the feeling of your partner’s skin. The goal is not to suppress the anxious thought but to let it pass without engaging it, then return attention to what is happening in your body.
Aerobic Exercise Has the Strongest Lifestyle Evidence
If you are looking for one lifestyle change with robust evidence behind it, regular aerobic exercise is it. A meta-analysis of eleven randomized controlled trials found that aerobic exercise significantly improved erectile function scores, and the benefit was dose-dependent: men with more severe baseline difficulties saw the largest gains.8PubMed. Effect of aerobic exercise on erectile function: systematic review and meta-analysis of randomized controlled trials The improvement was not trivial either. Men with severe erectile dysfunction showed roughly twice the improvement of those with mild problems, which suggests that exercise is doing something physiologically meaningful, not just acting as a mood booster.
The mechanism is primarily vascular. Erections depend on the health of the endothelium, the thin lining of blood vessels that produces nitric oxide to trigger smooth-muscle relaxation and blood flow. Research has established that men with erectile difficulties often have impaired endothelial function, even when they have no other obvious cardiovascular disease.9PubMed. Is endothelial function impaired in erectile dysfunction patients? In fact, erectile dysfunction is now recognized as an early warning sign of broader vascular problems, often appearing years before cardiovascular symptoms do.10The Journal of Sexual Medicine. The Endothelial–Erectile Dysfunction Connection: An Essential Update Exercise improves endothelial function throughout the body, and the penile arteries benefit along with everything else.
You do not need an extreme regimen. Most of the trials in the meta-analysis used moderate-intensity exercise like brisk walking, jogging, or cycling, typically around three to five sessions per week. The results suggest that consistent moderate exercise beats occasional intense workouts for this purpose.
Sleep Is an Underrated Factor
Most men know that a bad night’s sleep kills their energy, but few realize how directly sleep quality affects erection quality. Your body produces erections during sleep, particularly during REM phases, and these nocturnal erections are not just a byproduct of dreaming. Research using sleep trackers alongside erection monitors has found a close association between sleep parameters, especially REM sleep duration, and nocturnal erection quality.11Basic and Clinical Andrology. Association between sleep quality and nocturnal erection monitor by RigiScan in erectile dysfunction patients: a prospective study using fitbit charge 2
The damage from chronic short sleep goes beyond just missing out on nighttime erections. A review of the literature found evidence suggesting that short sleep reduces the frequency of REM-related erections, which may lead to insufficient blood flow to erectile tissue overnight, resulting in cumulative damage to the tissue itself.12PubMed Central. Short Sleep Duration and Erectile Dysfunction: A Review of the Literature Animal research has reinforced this, showing that chronic sleep deprivation led to oxidative stress, tissue damage, and even fibrosis in erectile tissue, independent of any change in testosterone levels.13International Journal of Impotence Research. The role of sleep stages in the regulation of erectile function: impacts of REM sleep fragmentation
The implication is that getting sufficient sleep, around seven to nine hours for most adults, is not just generally healthy but specifically protective of erectile function. If you are consistently sleeping under six hours, fixing that may do more for your erections than any supplement or technique.
Substances That Work Against You
Nicotine is one of the most reliably erection-hostile substances around. A controlled trial in nonsmoking men found that a single dose of nicotine reduced erectile response to erotic stimuli by about 23%.14PubMed Central. Acute Effects of Nicotine on Physiological and Subjective Sexual Arousal in Nonsmoking Men: A Randomized, Double-Blind, Placebo-Controlled Trial That is the acute effect of one dose in men who do not even smoke regularly. For habitual smokers, the chronic vascular damage from nicotine compounds the problem over years. If you vape or smoke, this is one of the most straightforward changes you can make.
Alcohol is more nuanced. A drink or two can reduce performance anxiety and make it easier to relax into sex, which is why many men report better erections with moderate alcohol. But beyond that modest zone, alcohol acts as a central nervous system depressant, dulling nerve signaling and making it harder to maintain arousal. Heavy or chronic drinking damages the cardiovascular and nervous systems in ways that produce lasting erectile problems. The common experience of “whiskey dick” after heavy drinking is a real physiological phenomenon, not just fatigue.
When Medication Makes Sense
PDE5 inhibitors, the class that includes sildenafil, tadalafil, and vardenafil, remain the most effective pharmacological option for most men. They work by blocking an enzyme that breaks down a chemical responsible for smooth-muscle relaxation in the penis, which means they amplify the normal arousal process rather than creating an erection from nothing. You still need some sexual stimulation for them to work. They are well-studied, widely available, and effective for the majority of men who try them.
These drugs are particularly useful when the issue is partly vascular, partly psychological, or a mix of both. Many men use them as a temporary confidence-building tool: after a few successful experiences with medication, the performance anxiety fades, and they no longer need the drug. Others with chronic vascular issues use them long-term. A conversation with a doctor is essential, both to get the right dose and to rule out contraindications like certain heart medications.
Medications That Can Cause the Problem
Sometimes the very medications you are taking for other conditions are what is undermining your erections. An analysis of the FDA’s pharmacovigilance database identified the medications most commonly linked to erectile dysfunction reports, and two categories dominated: 5-alpha reductase inhibitors used for hair loss or enlarged prostate, such as finasteride and dutasteride, which accounted for about 46% of reports, and neuropsychiatric medications, including antidepressants, which accounted for roughly 40%.15PubMed Central. Medications Most Commonly Associated With Erectile Dysfunction: Evaluation of the Food and Drug Administration National Pharmacovigilance Database Finasteride had by far the highest rate of disproportionate reporting among all medications evaluated.
If you started a new medication and noticed your erections declining within weeks to months, bring it up with your prescriber. SSRIs and other antidepressants are common offenders, but blood pressure medications, antihistamines, and certain anti-seizure drugs can all contribute. In many cases, switching to a different drug within the same class resolves the issue without sacrificing treatment of the original condition. Never stop a prescribed medication on your own, but do advocate for a conversation about sexual side effects.
Pelvic Floor Training
The pelvic floor muscles support the base of the penis and help maintain blood pressure within the erectile chambers during sex. Pelvic floor muscle training has been explored as a treatment for several male sexual health concerns, including erectile dysfunction and premature ejaculation.16Elsevier / Urology. Pelvic floor muscle training in males: practical applications The idea is that strengthening these muscles helps with the venous trapping mechanism that maintains rigidity.
To find the right muscles, try stopping your urine stream midflow. The muscles you engage to do that are the pelvic floor. The typical training protocol involves contracting and holding those muscles for a few seconds, then relaxing, and repeating for several sets per day. It is essentially the same as Kegel exercises recommended for women, adapted for male anatomy. The evidence base is modest, but the intervention is free, has no side effects, and can be done anywhere without anyone knowing. For men whose primary issue is losing rigidity after initially achieving it, pelvic floor strengthening is worth trying alongside other approaches.
Talking to Your Partner
This one gets dismissed as soft advice, but the data support it. A meta-analysis examining the relationship between sexual communication and various dimensions of sexual function found a positive association between how well couples communicate about sex and erectile function, along with desire, arousal, and orgasm.17PubMed Central. Couples’ Sexual Communication and Dimensions of Sexual Function: A Meta-Analysis The correlation with overall sexual function was even stronger than with any individual dimension.
In practice, this means that being able to tell your partner what feels good, what you need in the moment, or that you are feeling anxious is not just emotionally healthy but functionally useful. Performance pressure often intensifies in silence. When both partners understand that occasional softening is normal and not a referendum on attraction or desirability, the anxiety that drives the problem frequently dissipates. Many men report that simply naming the pattern out loud, something like “I sometimes lose my erection when I get in my head, and it has nothing to do with how attracted I am to you,” breaks the cycle more effectively than any physical intervention.
The Testosterone Question
Many men assume that if they are having erection trouble, their testosterone must be low. The reality is more specific than that. Research on the relationship between testosterone and erectile function suggests that there is a threshold effect: erectile function holds steady across a wide range of testosterone levels and only begins to decline when levels drop to roughly 10-12% of normal concentrations.18Journal of Andrology. Dose—Response Relationship Between Testosterone and Erectile Function: Evidence for the Existence of a Critical Threshold Below that threshold, function declines in a dose-dependent way, but above it, having more testosterone does not mean better erections.
This means that if your testosterone is in the normal range, supplementation is unlikely to help your erections and could cause other problems. If you have symptoms of genuinely low testosterone, including fatigue, loss of morning erections, reduced libido, and loss of muscle mass, getting tested makes sense. But chasing high-normal testosterone levels for erection quality is not well supported by the evidence.
What Changes With Age
Erections tend to take longer to achieve and may not be as rigid as they were at 20, and this is normal age-related physiology, not a disease. Part of what happens over time is structural remodeling of erectile tissue: the balance between cell growth and cell death shifts, and the tissue gradually develops more fibrous connective tissue, which is less elastic and less able to trap blood effectively.19PubMed Central. Erectile tissue molecular alterations with aging: differential activation of the p42/44 MAP Kinase pathway Endothelial function also declines with age, which can reduce penile blood flow even in the absence of cardiovascular disease. Research has shown that penile endothelial dysfunction can exist independently of problems in other blood vessels, meaning your heart and legs might have fine circulation while the smaller penile arteries are already affected.20PubMed. Penile and systemic endothelial function in men with and without erectile dysfunction
None of this means that age-related changes cannot be slowed or compensated for. The interventions discussed earlier, including exercise, sleep, and medication, are effective across age groups. The meta-analysis on aerobic exercise, for instance, included older men and still showed significant improvements. But it does mean that the baseline shifts. Comparing yourself at 50 to yourself at 25 is not a useful benchmark. A better question is whether your current function represents what your body can do given your current health habits, and whether modifiable factors like fitness, sleep, substance use, or medication side effects are dragging you below your actual potential.
Supplements and Diet
The supplement market for erectile enhancement is enormous and mostly unsupported by rigorous evidence. One exception worth mentioning is L-citrulline, an amino acid found in watermelon and available as a supplement. A small randomized crossover trial found that a combination of L-citrulline and resveratrol improved erectile function scores compared to placebo in men who were already using PDE5 inhibitors.21PubMed Central. Oral L-citrulline and Transresveratrol Supplementation Improves Erectile Function in Men With Phosphodiesterase 5 Inhibitors: A Randomized, Double-Blind, Placebo-Controlled Crossover Pilot Study L-citrulline works by boosting the body’s production of nitric oxide, the same signaling molecule that PDE5 inhibitors help preserve. The effect sizes are modest, and this was a small pilot study, so it should not be treated as a reliable standalone treatment. But it may offer a mild complementary benefit for men already doing other things right.
Broader dietary patterns matter more than any individual supplement. A Mediterranean-style diet rich in vegetables, fruits, whole grains, fish, and olive oil supports cardiovascular health, and since erectile function is fundamentally a vascular phenomenon, what is good for your arteries is good for your erections. Diets high in processed food, sugar, and saturated fat promote endothelial dysfunction over time. You are unlikely to notice a dietary change from one meal to the next, but over months and years, your eating pattern forms part of the vascular foundation that erections depend on.
Vacuum Devices as a Non-Drug Option
Vacuum erection devices are not glamorous, but they work mechanically and can be useful for men who cannot take medication or prefer a non-pharmacological approach. These devices create negative pressure around the penis, drawing blood into the erectile tissue, and then a constriction ring at the base traps the blood to maintain rigidity. Studies have reported that vacuum devices achieve sufficient rigidity for intercourse in about 77% of patients, with satisfaction rates ranging from roughly 56% to 84% depending on the underlying cause of dysfunction.22Nature. Vacuum therapy in erectile dysfunction—science and clinical evidence Men with primarily arterial problems tend to do better with them than men whose issue is venous leakage.
The downsides are that the erection can feel different from a natural one (cooler to the touch, sometimes with a hinge effect at the base), and spontaneity is limited since the device takes a minute or two to use. Some couples incorporate it into foreplay. For men recovering from prostate surgery or dealing with medication-resistant erectile dysfunction, vacuum devices remain a well-studied, low-risk option that does not require a prescription.