One thing you need to know. When you are experiencing anxiety, you get a stress response. You can read more about this here. A stress response is what you automatically feel, say, if a fight broke out near you. Your body gets ready to protect itself. During a stress response, blood is diverted away from less important areas to help your heart beat faster.
In terms of practical solutions, this is a common problem so there are some common aids. Drugs like Viagra or Cialis or Levitra work for many, many men. If his doctor recommends it, there’s no shame in popping a pill if it solves the problem — particularly if it helps alleviate the anxiety. Sometimes, a guy just needs to get his groove back for a while so he can relax and start having fun again. Also don’t forget the noble, oft-ignored cock ring, which constricts blood flow and helps men keep it up. They’re cheap and easy.
Impotence can have emotional causes but most often it is due to a physical problem. The physical causes of impotence include diseases (such as diabetes and hypertension), injuries (such as from prostate surgery), side-effects of drugs (such as the protease inhibitors used in HIV therapy), and disorders (such as atherosclerosis) that impair blood flow in the penis. Impotence is treatable in all age groups. Treatments include psychotherapy, vacuum devices, surgery and, most often today, drug therapy.
Currently, placement of a penile prosthesis is the most common surgical procedure performed for erectile dysfunction. Penile prosthesis placement is typically reserved for men who have tried and failed (either from efficacy or tolerability) or have contraindications to other forms of therapy including PDE5 inhibitors, intraurethral alprostadil, and injection therapy.
Causes contributing to erectile dysfunction can be broadly classified into two categories: organic and psychologic. In reality, while the majority of patients with erectile dysfunction are thought to demonstrate an organic component, psychological aspects of self-confidence, anxiety, and partner communication and conflict are often important contributing factors.
If a man's arteries become blocked with cholesterol – as a result of genetics, and/or lifestyle factors such as smoking, a poor diet and lack of exercise – it will affect the vessels all over his body. The arteries supplying the penis are relatively small, just 1-2mm wide, and so they become blocked more quickly than others. The blood flow to the area is reduced, meaning erections become more difficult.
An analysis of 14 studies involving more than 90,000 patients with ED confirmed the relation between ED and an increased risk of cardiovascular events and mortality.  Compared with patients without ED, those with ED had a 44% increased risk of cardiovascular events, a 25% increased risk of all-cause mortality, a 62% increased risk of MI, and a 39% increased risk of cerebrovascular events. Treatment of ED, either through lifestyle interventions or by pharmacologic means, may improve prognosis and reduce risk.
ED usually has something physical behind it, particularly in older men. But psychological factors can be a factor in many cases of ED. Experts say stress, depression, poor self-esteem, and performance anxiety can short-circuit the process that leads to an erection. These factors can also make the problem worse in men whose ED stems from something physical.