A lot of the time, the issue is a combination of both. For instance, cortisol – which is an important steroid hormone in the body – is released in greater amounts when we're stressed. It's supposed to briefly shut down non-essential functions like reproduction and fighting off illnesses whilst you deal with the danger at hand. However, the chronic and ongoing stress of modern life increases our background cortisol levels, activating the sympathetic system and stopping an erection.
First realize that this is normal, and just because it happened once does not mean it will happen again (but freaking out about it could make it happen again). Then Skyler tells people to completely ditch the idea that sex is a goal-oriented act with orgasm being the big finish. Instead, take a pleasure-oriented mentality where various sex acts are done because they feel good — not because it's part of series of steps to get you to climax. This helps take away some of the anxiety, because when you're not so focused on the performance, it's not that big of a deal if there's a little bit of stage fright, she says. There's plenty of other things you can do while hanging out with a non-erect penis!
Besides treating the underlying causes such as potassium deficiency or arsenic contamination of drinking water, the first line treatment of erectile dysfunction consists of a trial of PDE5 inhibitor (such as sildenafil). In some cases, treatment can involve prostaglandin tablets in the urethra, injections into the penis, a penile prosthesis, a penis pump or vascular reconstructive surgery.