How to get and maintain an erection
Medically reviewed by
Dr Crystal WyllieLast reviewed: 08 Jan 2026
At some point in their lives, most men have problems with getting and maintaining an erection. Difficulty getting or keeping an erection occasionally is common and usually not a cause for concern. However, if either of these problems happens regularly, you may have erectile dysfunction (ED).
Despite being very common, ED can be frustrating and may affect your self-esteem and relationships. ED is treatable, and many men see improvement with lifestyle changes, therapy, or medication. This guide explains the factors that affect erections and the steps you can take to improve them.
How erections work
An erection happens when increased blood flow fills the erectile tissue in the penis. Erections can happen through sexual stimulation or excitement, but they can also happen spontaneously.
When you’re aroused, your brain sends messages to the penis through your nervous system. The nerves signal the muscles in the corpora cavernosa (erectile tissue) to relax, allowing blood to enter and produce an erection.
Are there different types of erections?
Yes. There are 3 types of erections. These are known as:
- reflexogenic erections, which occur through direct physical stimulation
- psychogenic erections, which occur in response to thoughts or sensory cues
- nocturnal erections, which take place during REM sleep even when you are not sexually aroused
What causes erection problems?
ED can be caused by various factors. These can be physical, such as underlying medical conditions, or psychological, such as stress or anxiety. According to Asda Online Doctor’s research, over 1 in 3 men report experiencing some form of ED.
Several factors can contribute to erection loss, and often more than one plays a role.
Physical health causes
Research shows that 90% of people experiencing ED have at least 1 underlying physical cause, such as:
- diabetes
- high blood pressure
- high cholesterol levels
- being overweight or obese
- other long-term health conditions
These conditions can damage blood vessels, making it harder to achieve or maintain an erection. Managing these conditions with the help of your doctor can help reduce the impact on erectile function.
Although ED can affect you at any age, it’s more likely to happen if you are over the age of 50. As you get older, your blood vessels can get weaker, so your body will find it difficult to maintain a good blood flow to your penis.
If you need help to bring these physical causes under control and treat ED, speak to a doctor to make a plan tailored to you.
Lifestyle factors
Lifestyle habits can also affect your ability to maintain an erection, including:
- smoking
- excessive alcohol consumption
- a diet high in fat, salt, and sugar
Studies show that weight loss, regular exercise, quitting smoking, and improving diet can significantly improve erectile function, especially in men with obesity or metabolic syndrome.
Changes in medication
Some medicines can affect erections or libido. If you notice changes after starting a treatment, speak to your doctor or pharmacist for alternatives.
There are many medications and drugs that can have side effects that make it difficult to get an erection. These include:
- antihistamines
- certain blood pressure medicines, such as beta blockers
- chemotherapy medicines
- certain painkillers containing opiates
- recreational drugs such as alcohol and illegal drugs
Psychological causes
Psychological factors, such as stress, anxiety, and depression, can impact your ability to maintain an erection. Research has shown a significant link between anxiety disorders and ED.
To manage psychological causes, you can try:
- deep breathing exercises to calm the mind
- relaxing warm baths or showers
- gentle stretches to relieve muscle tension
You might also find that practising mindfulness and controlled breathing may help. Research suggests these methods can reduce anxiety and improve overall emotional wellbeing. Since stress can negatively affect sexual performance, these techniques may help some people feel more relaxed and focused.
ED can be physical, psychological, or a combination. Many men experience elements of each.
Ways to support healthy erectile function
There are several ways to treat ED, depending on the underlying cause, your lifestyle and personal preferences.
Lifestyle changes
Addressing the root causes of ED through lifestyle changes is essential not just for improving erectile function but for overall health. Some effective changes include:
- quitting smoking, as smoking reduces blood flow and increases the risk of ED
- increasing physical activity, which improves cardiovascular health and reduces stress
- eating a balanced diet to support overall health
- limiting alcohol consumption, which can impact hormone levels and blood flow
- ensuring adequate sleep for hormone regulation and healthy blood flow
- trying pelvic floor exercises to help increase blood flow and strengthen key muscles involved in getting and maintaining erections
Medication that can help with getting and keeping erections
Medications like Viagra, sildenafil, and Vitaros cream can improve erectile function by increasing blood flow to the penis when sexually aroused.
Tablets
Tablets such as Viagra and Spedra work by inhibiting the enzyme phosphodiesterase type 5 (PDE5), which helps relax the blood vessels in the penis, improving blood flow when you're sexually aroused. They typically take 30 to 60 minutes to work, except Spedra, which works in 15 to 30 minutes.
Tablets include:
- Viagra (sildenafil and Viagra Connect)
- Spedra
- vardenafil
- tadalafil (brand name: Cialis)
To take them, you should swallow the tablets whole with a drink of water around 1 hour before any sexual activity (except for Spedra, which works faster). ED medications will not work on their own and require sexual arousal. You should not take them with grapefruit juice, as it could affect the way the medication works.
— Dr Crystal WyllieRemember that ED medications enhance the body’s natural erection process, so sexual arousal is still required for them to work. You must only take 1 tablet (or 1 dose) in 24 hours, and you should only take 1 treatment at a time. Taking more will increase the risk of side effects and can be dangerous. Speak to your doctor if your current treatment is not helping.
The effects of ED medications typically last from 4 to 5 hours, with the exception being tadalafil (also found under the brand name Cialis), which can last up to 36 hours. If you take ED medication and get a painful erection, especially if it lasts more than 4 hours, you should speak to a doctor or go to A&E straight away.
Cream
Vitaros cream, which contains alprostadil, can be used as an alternative to tablets if you're unable to swallow pills or if they contain ingredients that may be harmful to you (such as things you’re allergic to). It works faster, typically within 5 to 30 minutes, and is effective if you have nerve damage. You apply the cream using a small, single-use applicator, which delivers the cream directly to the opening at the tip of your penis (the urethra).
Psychotherapy
Psychotherapy can help address the emotional factors affecting erectile function by providing a safe, supportive space to explore underlying issues. Therapy sessions typically involve discussing concerns such as performance anxiety, stress, and relationship dynamics.
By working with a trained therapist, you can learn more about what might be causing your ED, learn to think about intimacy in different ways and find out about ways to communicate with your partner.
You can speak to a doctor to find out more about sex therapy or find a private therapist through the College of Sexual and Relationship Therapists.
Order erectile dysfunction treatment
If you're struggling with ED, medications are available to help. These treatments can include:
No results found.
Please check your spelling or try another treatment name.
➤ You can order ED treatments from Asda Online Doctor, with a discreet and convenient delivery service.
When to talk to a doctor about erection problems
We recommend speaking to your doctor if you:
- regularly have difficulty getting or keeping an erection
- suspect you may have a medical condition such as diabetes, low testosterone, or high blood pressure
- feel distressed about changes in your sexual function
- have other symptoms such as changes in sexual desire, fatigue, or mood changes
Your doctor will discuss your symptoms and medical history to identify any underlying causes, which could be physical, psychological, or a combination of both. Depending on the cause, they may recommend lifestyle changes, medication or therapy to help manage symptoms and improve erectile function.
Frequently asked questions
Does losing an erection mean I have erectile dysfunction?
No. If you lose an erection, this does not mean you have ED. It’s common to lose an erection from time to time, for example, when you’re tired, stressed, or feeling anxious. If it starts to happen regularly, speak with a doctor.
How can I get hard quickly?
You can use ED medications like Viagra or Cialis to help achieve an erection. Typically, Viagra and Cialis can take about 30 minutes to 1 hour to start working, with effects lasting up to 4 to 36 hours, depending on the medication. However, medication works best when combined with long-term lifestyle changes for lasting improvements in erectile health.
Improving your overall health through a healthy diet and regular exercise can have a lasting positive impact on your erections. These lifestyle changes help improve blood circulation, reduce stress, and maintain a healthy weight, all of which support long-term erectile function. While lifestyle improvements may take time to show full effects, they are important for ongoing sexual health.
Why can I not get hard even though I’m turned on?
There are a number of other things that can impact your ability to get hard, such as:
- stress or anxiety
- underlying health conditions
- certain medications
- a hormonal imbalance
- alcohol
It’s important to understand the root cause of ED in order to take the right steps towards improvement. In many cases, lifestyle changes, such as managing stress or improving diet and exercise, can make a significant difference. For others, medical assistance in the form of pills or creams may be needed to help restore erectile function.
Can anxiety stop me from getting hard?
Yes, anxiety can stop you from getting an erection. Stress and anxiety trigger the release of hormones like cortisol that interfere with the body's ability to achieve and maintain sexual arousal and erections. Anxiety can also be a distraction that takes you out of the present moment and impacts your arousal.
What should I do if I get hard but lose it during sex?
If you’re able to get an erection but lose it during sex, this can be disappointing. Remember that this is common, and most men get it from time to time. It’s helpful to talk to your sexual partner to avoid misunderstandings.
It may be a one-off event, but if it continues, speak with your GP. They can assess whether there are any underlying physical or psychological causes and recommend appropriate treatments, such as prescription ED medication, to help maintain erectile function during sex.
Crystal qualified in Medicine at Barts and the London School of Medicine and Dentistry in 2010. She then trained as a GP in London hospitals and practices. She has a particular interest in reproductive, sexual, and women’s health.
Meet our doctorsLast reviewed: 08 Jan 2026
-
Prevalence, Comorbidities, and Risk Factors of Erectile Dysfunction, International Journal of Clinical Practice [accessed 17 December 2025]
-
Physiology of Penile Erection and Pathophysiology of Erectile Dysfunction, Urologic Clinics of North America [accessed 17 December 2025]
-
Sleep-related erections: neural mechanisms and clinical significance, Current Neurology and Neuroscience Reports [accessed 10 November 2025]
-
Erectile dysfunction (impotence), The British Association of Urological Surgeons [accessed 10 November 2025]
-
Lifestyle modifications and erectile dysfunction: what can be expected?, Asian Journal of Andrology [accessed 17 December 2025]
GMC: 7074021
GMC: 6149065
GMC: 7085115