There are no formal tests to diagnose erectile dysfunction. Some blood tests are generally done to exclude underlying disease, such as hypogonadism and prolactinoma. Impotence is also related to generally poor physical health, poor dietary habits, obesity, and most specifically cardiovascular disease such as coronary artery disease and peripheral vascular disease. Therefore, a thorough physical examination is helpful, in particular the simple search for a previously undetected groin hernia since it can affect sexual functions in men and is easily curable.
If PDE5 drugs don't work or cannot be used because of potential side effects, your doctor can recommend other therapies. The drug alprostadil (Caverject, Edex, Muse) allows blood to flow more freely in the penis, leading to an erection. The drug can be injected with a tiny needle into your penis. Or, a small pellet (suppository) can be inserted into the opening of the penis. Suppositories and injections are effective in the majority of men.
In other cases, men who habitually use alcohol or other drugs may experience similar results. Alcohol is a depressant to the central nervous system. This means that a little bit might be able to lighten the mood, but too much can basically shut down all communication between the brain and the penis. When this happens, no amount of will or stimulation will result in an erection. Other drugs can also affect the body’s ability to achieve an erection, including heroin and MDMA, otherwise known as ecstasy.
Trauma to the pelvic blood vessels or nerves can also lead result in ED. Bicycle riding for long periods has been implicated as an etiologic factor; direct compression of the perineum by the bicycle seat may cause vascular and nerve injury.  On the other hand, bicycling for less than 3 hours per week may be somewhat protective against ED.  Some of the newer bicycle seats have been designed to diminish pressure on the perineum. [37, 38]
Most bouts of ED can be explained away by stress, anxiety, or nervousness. If erectile dysfunction becomes frequent, don’t panic, but cover your bases by seeing a doctor to rule out scarier causes like diabetes or prostate cancer. Medications like antidepressants can also cause boner loss. Unless you can’t get it up after a date because you spent the day snorting coke and fucking your ex (in which case figure some shit out before you see other people) this line places the blame on the stress of work and away from your partner. While a woman will usually be understanding, she may fear you can’t get hard because you’re not attracted to her. Ease these anxieties with this line. Even if work was great and you’re having trouble getting it up because of other stress, like a text from an ex or family shit you’re not ready to disclose, I’ll allow a little white lie in this instance.
The more you puff, the more you put your penis at risk, according to a study from the Tulane University School of Public Health and Tropical Medicine. The researchers examined 7,684 men between the ages of 35-74 and concluded about 23 percent of erectile dysfunction cases can be chalked up to cigarette smoking. This is probably the best motivator If you've been struggling to quit.
You're not hard. You're about to have sex for the first time with your date, who's truly beautiful. All you want to do is present your glorious, super strong erection and let it do the talking. And yet when you look down, you're limp instead of hard. This doesn't make any sense! you think. Every element you could possibly need for an erection is here. Nudity, beauty, passion, the tantalizing thrill of boning someone for the first time, and a little bit of booze to take the edge off. What on earth is wrong and why are you so unlucky? You turn to your date. "I swear, this never happens..."
Erections occur in response to tactile, olfactory, and visual stimuli. The ability to achieve and maintain a full erection depends not only on the penile portion of the process but also on the status of the peripheral nerves, the integrity of the vascular supply, and biochemical events within the corpora. The autonomic nervous system is involved in erection, orgasm, and tumescence. The parasympathetic nervous system is primarily involved in sustaining and maintaining an erection, which is derived from S2-S4 nerve roots.
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. 
PDE 5 inhibitors are broken down primarily by enzyme, cytochrome P450enzyme CYP3A4. Medications that decrease or increase the activity of CYP3A4 may affect levels and effectiveness of PDE 5 inhibitors. Such drugs include medications for the treatment of HIV (protease inhibitors) and the antifungal medications ketoconazole and itraconazole. Thus caution is recommended.