Getting hard requires your brain, nervous system, and blood vessels to work together in a precise sequence. When something triggers arousal, whether it’s physical touch, a visual stimulus, or a thought, your nervous system sends signals that relax blood vessels in the penis and allow blood to rush in. That blood gets trapped under pressure, creating rigidity. When any part of this chain gets disrupted, erections become difficult or unreliable.
What Happens Inside Your Body
An erection starts with a signal. Your brain’s arousal centers, located in the hypothalamus and surrounding areas, send nerve impulses down the spinal cord to the pelvis. These signals travel through the parasympathetic nervous system, which is the branch of your nervous system responsible for “rest and digest” functions. This pathway is specifically pro-erectile: it triggers the release of a gas molecule called nitric oxide inside the penile tissue.
Nitric oxide is the key chemical that makes an erection possible. It causes the smooth muscle lining the blood vessels and internal chambers of the penis to relax and widen. The penis contains two cylindrical chambers filled with a sponge-like network of spaces, somewhat like Swiss cheese. When nitric oxide relaxes the surrounding muscle, arterial blood floods into these spaces and expands them.
What keeps the blood trapped is a tough outer sheath of connective tissue that surrounds these chambers. As the spongy tissue swells, small veins get compressed against this outer wall, cutting off the blood’s exit route. The sheath itself is one of the strongest connective tissues in the body, capable of withstanding enormous internal pressure. This combination of blood rushing in and veins being squeezed shut is what produces firmness.
Two Pathways to an Erection
Your body can produce an erection through two distinct routes. The first is triggered by physical touch to the genitals or surrounding area. Sensory nerves in the skin send signals to the lower spinal cord, which can initiate an erection reflexively, without any input from the brain. This is why erections can happen during sleep or from physical contact alone.
The second pathway starts in the brain. Visual stimuli, fantasies, sounds, or memories activate arousal centers that send signals downward through the spinal cord. These “psychogenic” erections rely on a more complex chain involving multiple brain regions and neurotransmitters, including dopamine and serotonin. In practice, most erections involve both pathways working together: mental arousal combined with physical sensation produces the strongest response.
Nocturnal erections, the ones that happen during sleep, appear to be more sensitive to hormone levels than erections triggered by visual stimuli. This is one reason morning erections can serve as a rough indicator that the physical plumbing is working, even when erections during sex are unreliable.
How Your Body Reverses It
The process of going soft happens in three phases. First, arterial blood flow starts to decrease. Then the smooth muscle in the penile chambers gradually contracts again, driven by the sympathetic nervous system (the same system behind your fight-or-flight response). Finally, the compressed veins reopen and blood drains rapidly, returning the penis to its resting state.
After orgasm, a refractory period kicks in during which getting hard again is temporarily impossible. For younger men this can be as short as a few minutes. As you age, it typically stretches to 12 to 24 hours or longer. There’s wide individual variation, and no specific refractory period is “normal.”
Why Stress and Anxiety Block Erections
The nervous system pathways that produce erections and the ones that handle stress are essentially opponents. The parasympathetic system promotes erections. The sympathetic system, which activates during anxiety, fear, or pressure, actively works against them. When your fight-or-flight response kicks in, your body prioritizes functions needed to handle a threat: faster heart rate, deeper breathing, blood diverted to large muscles. It simultaneously shuts down functions it considers nonessential, and erections are one of the first to go.
This is why performance anxiety creates a vicious cycle. Worrying about getting hard activates the exact system that prevents it, which increases the worry, which further suppresses the erectile response. The mechanism is entirely involuntary. You can’t override it with willpower any more than you can stop your heart from racing when you’re startled.
Erection Difficulty Is Common at Every Age
A 2021 national survey found that erection problems aren’t limited to older men. About 17.9% of men aged 18 to 24 met diagnostic criteria for erectile dysfunction, which was actually higher than the rate for men aged 25 to 34 (13.3%) or 35 to 44 (12.7%). Rates climb more steeply after middle age: 25.3% for men 45 to 54, 33.9% for men 55 to 64, and roughly half of men over 65.
The higher rate among the youngest group likely reflects anxiety, inexperience, and psychological factors rather than vascular problems. For men over 45, the causes increasingly involve blood flow and cardiovascular health.
Blood Flow Is the Foundation
Because erections depend entirely on blood flow, anything that affects your cardiovascular system affects erection quality. The arteries supplying the penis are smaller than those supplying the heart, so they tend to show signs of damage earlier. The Mayo Clinic considers erectile difficulty a potential early warning sign of cardiovascular disease.
The lifestyle factors that improve heart health also improve erections. In one randomized trial, a structured program of diet and exercise resolved erectile dysfunction in a third of participants. Smoking constriction of blood vessels is one of the most direct causes of reduced erection quality. Weight loss, regular aerobic exercise, and smoking cessation all produce measurable improvements. These aren’t minor effects: for many men, particularly those under 50, lifestyle changes alone can restore reliable function without any other intervention.
Sleep also plays a role. Poor or insufficient sleep disrupts testosterone production and increases stress hormones, both of which work against the erectile process. Alcohol in small amounts may reduce anxiety, but larger quantities suppress the nervous system signals needed to initiate and maintain an erection.
What Actually Helps
If you’re having trouble getting or staying hard, the first question is whether the issue is situational or consistent. If you get firm erections during sleep or when masturbating but not with a partner, the cause is almost certainly psychological: anxiety, stress, relationship tension, or pressure. If erections are weak or absent across all situations, including morning erections, a physical cause is more likely.
For anxiety-driven problems, breaking the worry cycle is the priority. Shifting focus away from performance and toward sensation, reducing pressure around intercourse, and addressing relationship dynamics all help. Some men find that simply understanding the sympathetic nervous system mechanism described above reduces their anxiety enough to break the pattern.
For physical causes, cardiovascular fitness is the single most impactful factor you can control. Regular exercise that gets your heart rate up improves the function of the blood vessel lining throughout your body, including in the penis. Maintaining a healthy weight reduces inflammation that damages blood vessels over time. Quitting smoking produces noticeable improvements in erection quality within weeks to months.

