The vascular processes that produce an erection are controlled by the nervous system and certain prescription medications may have the side effect of interfering with necessary nerve signals. Among the possible culprits are a variety of stimulants, sedatives, diuretics, antihistamines, and drugs to treat high blood pressure, cancer, or depression. But never stop a medication unless your doctor tells you to. In addition, alcohol, tobacco, and illegal drugs, such as marijuana, may contribute to the dysfunction.
Radical prostatectomy for the treatment of prostate cancer poses a significant risk of ED. A number of factors are associated with the chance of preserving erectile function. If both nerves that course on the lateral edges of the prostate can be saved, the chance of maintaining erectile function is reasonable. The odds depend on the age of the patient. Men younger than 60 years have a 75-80% chance of preserving potency, but men older than 70 years have only a 10-15% chance.
Once a complete sexual and medical history has been completed, appropriate laboratory studies should be conducted. In the initial evaluation of ED, sophisticated laboratory testing is rarely necessary. For example, serum testosterone (and sometimes prolactin) is typically only useful when the patient demonstrates hypogonadal features or testicular atrophy, or when clinical history is suggestive. Additional hormonal evaluation may include thyroid stimulating hormone in those with a clinical suspicion of hypothyroidism or appropriate diabetes screening in those presenting with a concern for impaired glucose metabolism. If the patient has not been evaluated with a lipid panel and hyperlipidemia is suspected, measurement and appropriate referral to internal medicine or cardiology is recommended. In most cases, a tentative diagnosis can be established with a complete sexual and medical history, physical examination, and limited or no laboratory testing.
Commercials for drugs to improve “low T,” or testosterone, the male hormone, are now vying for airtime, but they address desire, not performance. "Male hormone is not an approved treatment for erectile dysfunction," notes Bennett. "It may be used to increase desire in men who have low testosterone, but it doesn’t improve blood flow to an erection." A doctor can do a blood test to check you for low testosterone, but it is a rare cause of ED. Hormone therapy with injections, patches, or gels applied to the skin may improve mood and sex drive, but it likely won’t fix any mechanical issues. Also, testosterone drugs should not be used by men with prostate cancer. Side effects include acne, breast enlargement, prostate enlargement, and fluid retention.
A common and important cause of ED is vasculogenic. Many men with ED have comorbid conditions such as hyperlipidemia, hypercholesterolemia, tobacco abuse, diabetes mellitus, or coronary artery disease (CAD).  The Princeton III Consensus recommends screening men who present with ED for cardiovascular risk factors; ED may be the earliest presentation of atherosclerosis and vascular disease. 
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.