"Medications that create blood flow to the penis can't help when an erection is blocked by the fear or anxiety of the fight-or-flight response,” says Feloney. “This type of erectile dysfunction probably has a lot to do with evolution — men didn't need an erection when a dinosaur was chasing them." The best way to treat erectile dysfunction caused by performance anxiety, depression, a poor relationship, or stress may be with a combination of ED drug treatment and sex therapy, individual therapy, or couples therapy from sexual health professionals.
Exercise and lifestyle modifications may improve erectile function. Weight loss may help by decreasing inflammation, increasing testosterone, and improving self-esteem. Patients should be educated to increase activity, reduce weight, and stop smoking, as these efforts can improve or restore erectile function in men without comorbidities. Precise glycemic control in diabetic patients and pharmacologic treatment of hypertension may be important in preventing or reducing sexual dysfunction. 
While erectile dysfunction can occur at any age, the risk of developing erectile dysfunction increases with age. According to the Massachusetts Male Aging Study, the prevalence of erectile dysfunction was 52% in men 40-70 years of age. The prevalence of complete erectile dysfunction increases from 5% at 40 years of age to 15% among men 70 years of age and older.
Surgery: If neither drugs nor the vacuum pump works, your doctor may suggest surgery. With surgery, the doctor can place a device in your penis that will cause enough hardness for intercourse. In a few cases, infections may develop after the operation, and the doctor may have to remove the device. Another operation that may help you is rebuilding the blood vessels in the penis to increase blood flow into the penis or decrease blood flow out of the penis. These procedures can help you to get and maintain an erection.
The primary nerve fibers to the penis are from the dorsal nerve of the penis, a branch of the pudendal nerve. The cavernosal nerves are a part of the autonomic nervous system and incorporate both sympathetic and parasympathetic fibers. They travel posterolaterally along the prostate and enter the corpora cavernosa and corpus spongiosum to regulate blood flow during erection and detumescence. The dorsal somatic nerves are also branches of the pudendal nerves. They are primarily responsible for penile sensation. 
The other 5 percent of prostheses are either pump devices in which the saline is permanently in the prosthesis, not in a separate reservoir (urologists may recommend this for men who have had multiple surgeries); or a pair of semi-rigid, malleable rods implanted in the penis, which render it hard at all times. The patient manually shifts the penis into an erect position for sex.
Diabetes is an example of an endocrine disease that can cause a person to experience impotence. Diabetes affects the body’s ability to utilize the hormone insulin. One of the side effects associated with chronic diabetes is nerve damage. This affects penis sensations. Other complications associated with diabetes are impaired blood flow and hormone levels. Both of these factors can contribute to impotence.
Palmer MR, Holt SK, Sarma AV, Dunn RL, Hotaling JM, Cleary PA, Braffett BH, Martin C, Herman WH, Jacobson AM, Wessells H; Diabetes Control and Complications Trial and Epidemiology of Diabetes Interventions and Complications Research Group. Longitudinal Patterns of Occurrence and Remission of Erectile Dysfunction in Men With Type 1 Diabetes. J Sex Med. 2017 Oct;14(10):1187-1194. Doi: 10.1016/j.jsxm.2017.07.012. Epub 2017 Aug 26.
Certain types of blood pressure medications, antiulcer drugs, antihistamines, tranquilizers (especially before intercourse), antifungals (hetoconazole), antipsychotics, antianxiety drugs, and antidepressants, known as selective serotonin reuptake inhibitors (SSRIs, including Prozac and Paxil), can interfere with erectile function. Smoking, excessive alcohol consumption, and illicit drug use may also contribute. In rare cases, low levels of the male hormone testosterone may contribute to erectile failure. Finally, psychological factors, such as stress, guilt, or anxiety, may also play a role, even when the impotence is primarily due to organic causes.
inability of the male to achieve or maintain an erection of sufficient rigidity to perform sexual intercourse successfully. An impotent man may produce sufficient numbers of normal spermatozoa; the condition is related to infertility only insofar as it prevents coitus with and impregnation of the female partner. Called also erectile dysfunction. adj., adj im´potent.
Impotence is a common problem among men and is characterized by the consistent inability to sustain an erection sufficient for sexual intercourse or the inability to achieve ejaculation, or both. Erectile dysfunction can vary. It can involve a total inability to achieve an erection or ejaculation, an inconsistent ability to do so, or a tendency to sustain only very brief erections.
Quitting smoking, exercising regularly, losing excess weight, curtailing excessive alcohol consumption, controlling hypertension, and optimizing blood glucose levels in patients with diabetes are not only important for maintaining good health but also may improve or even prevent progression of erectile dysfunction. It is unclear if such lifestyle changes can reverse erectile dysfunction. However, lifestyle improvements may prevent progression of the erectile dysfunction. Some studies suggest that men who have made lifestyle improvements experience increased rates of success with oral medications.
A vacuum erection device is a plastic tube that slips over the penis, making a seal with the skin of the body. A pump at the other end of the tube makes a low-pressure vacuum around the erectile tissue, which results in an erection. An elastic ring is then slipped onto the base of the penis. This holds the blood in the penis (and keeps it hard) for up to 30 minutes. With proper training, 75 out of 100 men can get a working erection using a vacuum erection device.