
Viagra (sildenafil) works by increasing blood flow to the penis, which makes it easier to get and keep an erection when you're sexually aroused. It's usually taken about an hour before sex and can be taken anywhere from 30 minutes to 4 hours beforehand, but it doesn't normally cause an erection unless you're turned on (FDA, 2014).
When you're aroused, your body makes more of a chemical called cGMP, which relaxes the blood vessels in your penis so blood can flow in. An enzyme called PDE5 breaks cGMP down, and Viagra blocks that enzyme, so blood flow into the penis is easier to keep going (Corbin, 2004). Viagra doesn't treat stress or anxiety itself, but it can still help with erections when those play a part, and US urology guidelines suggest a mental health professional can help alongside treatment (Burnett et al., 2018).
Before you take Viagra, check with a doctor or pharmacist first, especially if you have heart problems or take other medicines. Never take it with nitrates or nitrites in any form, including some chest-pain medicines and the recreational drug "poppers," because the mix can make your blood pressure drop too low. Tell your doctor if you take alpha-blockers, a type of blood pressure or prostate medicine, and don't take Viagra more than once a day. Get medical help right away if an erection lasts more than 4 hours, or if you suddenly lose vision or hearing (FDA, 2014).
Viagra's active ingredient is sildenafil. To understand what sildenafil actually does, it helps to see what your body does on its own first.
Sexual stimulation sends nerve signals to the penis. Those signals release a molecule called nitric oxide. Nitric oxide raises the level of another molecule, cGMP, inside penile tissue. Higher cGMP relaxes smooth muscle in the corpus cavernosum, the spongy tissue that fills with blood during an erection.
As that muscle relaxes, blood vessels widen and more blood flows in, which is what makes an erection firm.
PDE5 breaks cGMP back down. That's one of several things that bring an erection to an end, along with sexual stimulation easing off and the smooth muscle tightening again. It's also normal for an erection to fade during sex and come back. Sildenafil blocks PDE5, so cGMP sticks around longer, which helps you keep an erection during sexual stimulation (Corbin, 2004). It supports your body's natural response, so it can't guarantee an erection or how long one lasts. Sildenafil doesn't create nitric oxide, and it doesn't create cGMP. It slows down the enzyme that would otherwise clear cGMP away.
Here is the same process laid out step by step.
| Step | What happens in the body | Result |
|---|---|---|
| 1. Arousal signal | Sexual stimulation triggers nerve signals to the penis | Nitric oxide is released |
| 2. Nitric oxide → cGMP | Nitric oxide raises levels of cGMP in penile tissue | Smooth muscle in the corpus cavernosum starts to relax |
| 3. PDE5's normal job | PDE5 enzyme breaks cGMP back down | One of the ways an erection fades, along with less stimulation and the smooth muscle tightening |
| 4. Viagra blocks PDE5 | Sildenafil inhibits PDE5, so cGMP isn't broken down as fast | Blood vessels stay wider for longer, which helps maintain an erection during sexual stimulation |
Other sources describe this same pathway, which lines up with the mechanism above (StatPearls, 2024).
Notice that arousal comes first in every version of this chain. It's why Viagra needs sexual stimulation to work.
The most common side effects are headache, flushing (a red, warm face), indigestion or heartburn, a stuffy nose, a color tint to your vision, back pain, and dizziness (FDA, 2014).
Heartburn happens because sildenafil relaxes smooth muscle elsewhere in the body too, which can loosen the valve that normally keeps stomach acid down. If that happens to you, here's how to deal with the heartburn side effect from Viagra. If flushing is the problem, here's how to get rid of red face from Viagra.
Viagra helps along a process your body has already started. It doesn't start that process itself. Without the nerve signals and nitric oxide release that begin with arousal, there's no rise in cGMP for Viagra's PDE5-blocking effect to protect, so it doesn't normally produce an erection on its own.
This is why a pill can support an erection but can't create desire or calm anxiety by itself. If low desire or anxiety is part of the problem, other kinds of support can work alongside it.
Doctors often sort the causes of erectile dysfunction into physical and psychological, but in real life the two often overlap. Many men have a mix of both, and one can feed the other. Viagra works on blood flow, so it can help in many cases, including when stress or anxiety is part of the picture.
| Type of factor | Examples |
|---|---|
| Physical factors | Heart disease, diabetes, kidney disease, hypertension, nervous system conditions, nerve damage after prostate surgery, certain blood-pressure medications |
| Psychological factors | Performance anxiety, stress, relationship conflict, depression, negative body image, past sexual trauma |
The physical list above covers conditions that can affect blood vessels, nerves, or hormone levels, which is why they can interfere with an erection even when arousal and desire are both present (Yafi et al., 2016). Heart disease and diabetes, for example, can harm the small blood vessels and nerves an erection depends on, so blood flow may be reduced. The effect varies a lot from man to man, and having one of these conditions doesn't mean erections are off the table. Nerve damage after prostate surgery can interrupt the signal traveling from the brain to the penis, even when the blood vessels themselves are healthy.
Psychological factors can get in the way before arousal builds, and anxiety can also make an erection fade after arousal has already started. They can affect the body too. Anxiety, for example, can act on blood vessels through the body's threat response, which we cover below. Relationship conflict and past sexual trauma can make the brain link sex with tension instead of safety.
If you want a clearer picture of what's behind your own ED, here's how to tell if ED is physical or psychological.
It can help with the erection itself, but it doesn't treat the stress, anxiety, or other factors behind it. US urology guidelines say men with ED should be told about medicines like Viagra as a treatment option, and that doctors should consider referring men to a mental health professional, for example to reduce performance anxiety (Burnett et al., 2018). Our guide on whether Viagra helps psychological ED goes into more detail.
Dr. Ramesh Krishnan, a board-certified urologist with more than 20 years in practice, puts it plainly: "They can give you a one-off erection, but they can't treat the underlying cause." The pill supports blood flow, and the worry behind the problem needs its own attention.
For some men, a pill that doesn't work as hoped can add pressure. A man who already worries about performing may take it as a sign that something is badly wrong, and feel more anxious next time. This doesn't happen to everyone, and knowing what Viagra can and can't do before you try it can help.
Combining approaches looks promising. In one small trial of young men in Pakistan whose ED had no physical cause, sex therapy based on cognitive behavioral therapy (CBT) improved erection scores compared with a placebo, and so did the same therapy combined with Viagra (Bilal & Abbasi, 2022). One study in one country can't settle the question, but it fits the idea that talking support and medication can work together.
Mojo's Erection Reset program, built by Dr. Shannon Chavez, focuses on the psychological side of ED.
Anxiety is one common way psychological factors affect erections, though it isn't the only one. Amanda Barge, an accredited COSRT and BACP therapist, explains that psychological erectile dysfunction can involve the body's fight-or-flight response. Anxiety can switch on the sympathetic nervous system, the part of the body that reacts to a threat. Stress hormones like adrenaline then tighten blood vessels and send blood toward the muscles you'd use to run or fight, and away from the penis.
That's why a healthy man can feel turned on and still lose an erection when he's anxious. Viagra doesn't calm this reaction, but it may still help with the erection while anxiety is present. Managing the anxiety itself is a separate job.
Other psychological factors work in different ways. Low desire, depression, distraction, and relationship problems can all play a part, with or without a threat response.
If Viagra isn't working for you, talk to a doctor. A doctor can help work out why and what to try next. Viagra not working doesn't by itself mean the cause is psychological. Common reasons include:
If stress or anxiety is part of the picture, medication and psychological support can work side by side. Erection treatment options beyond medication focus on those factors.
That's where Mojo's Erection Reset program comes in. Built with Dr. Shannon Chavez, it focuses on the psychological factors that can affect erections, like stress and performance anxiety. It doesn't diagnose or treat ED. It gives you tools and exercises to work on those factors, and you can use it alongside medical care.
No. It blocks PDE5, an enzyme that breaks down cGMP, which helps blood flow into the penis during arousal (Corbin, 2004). It doesn't cure ED or treat what's causing it.
Viagra reaches its highest level in your blood 30 minutes to 2 hours after you take it, usually around an hour. A high-fat meal can slow this down by about an hour. That's why it's usually taken about an hour before sex, though it can be taken anywhere from 30 minutes to 4 hours beforehand. Separately, the amount in your blood halves about every 4 hours, which shows how fast your body clears it rather than exactly how long the effect lasts (FDA, 2014).
Because the drug helps along a process your body has already started. At normal doses, sildenafil doesn't produce an erection without sexual stimulation, though it still has other effects in the body, such as a small drop in blood pressure (FDA, 2014).
It can help with the erection, though it doesn't treat stress or anxiety itself. US guidelines suggest doctors consider referring men to a mental health professional alongside treatment, for example to help with performance anxiety (Burnett et al., 2018). For some men, a pill that doesn't work as hoped can add to the worry, so it helps to know what to expect.
Don't take it if you use nitrates or nitrites in any form, including "poppers," or if you're allergic to sildenafil. Check with a doctor first if you have heart problems or take alpha-blockers or other blood pressure medicines (FDA, 2014).
Heart disease, diabetes, kidney disease, hypertension, nervous system conditions, nerve damage after prostate surgery, and certain blood-pressure medications (Yafi et al., 2016).
No. Other medicines in the same family, like tadalafil, work in a similar way (Corbin, 2004). Erection treatment options beyond medication also exist, including approaches for the psychological side of ED, and many men use more than one.
Mojo aims to provide useful wellbeing resources to its users; however, you should not solely rely on opinions or advice available on the Website or given by the Community. Always seek advice from a qualified medical doctor or other healthcare professional before acting.

With 18 years as an accredited COSRT and BACP therapist, Amanda helps people navigate desire, intimacy, and the changes life brings.

A neurobiologist and science communicator, Paula turns research on the brain, behaviour and health into clear, evidence-based education about mental, physical, and sexual well-being.