Before taking any medication for erectile dysfunction, including over-the-counter supplements and herbal remedies, get your doctor's OK. Medications for erectile dysfunction do not work in all men and might be less effective in certain conditions, such as after prostate surgery or if you have diabetes. Some medications might also be dangerous if you:

Ultrasound with Doppler imaging (ultrasound plus evaluation of blood flow in the arteries and veins) can provide additional information about blood flow of the penis and may help in the evaluation of patients prior to surgical intervention. This study is typically performed after the injection of a chemical that causes the arteries to open up, a vasodilator (prostaglandin E1), into the corpora cavernosa in order to cause dilation of blood vessels and promote blood flow into the penis. The rate of blood flow into the penis can be measured along with an evaluation of problems with compression of the veins.
Diabetes mellitus: Erectile dysfunction tends to develop 10 to 15 years earlier in diabetic men than among nondiabetic men. The increased risk of erectile dysfunction among men with diabetes mellitus may be due to the earlier onset and greater severity of atherosclerosis (hardening of the arteries) that narrows the arteries and thereby reduces the delivery of blood to the penis. Atherosclerosis can affect the arteries in the penis, as well as the arteries in the pelvis that supply the penile arteries. Diabetes mellitus also causes erectile dysfunction by damaging nerves that go to the penis, much like the effect of diabetes on nerves in other areas of the body (diabetic neuropathy). Diabetes can also affect the muscles in the penis, leading to troubles with erections. Smoking cigarettes, obesity, poor control of blood glucose levels, and having diabetes mellitus for a long time further increase the risk of erectile dysfunction in people with diabetes.
Think of erectile dysfunction as your body’s “check engine light.” The blood vessels in the penis are smaller than other parts of the body, so underlying conditions like blocked arteries, heart disease, or high blood pressure usually show up as ED before something more serious like a heart attack or stroke. ED is your body’s way of saying, “Something is wrong.” And the list of things that cause erectile dysfunction can include:

Something else to consider is your porn use.  If you are masturbating to very stimulating porn on a regular basis then it might be difficult to get as aroused in the bedroom with your partner.  Watching video pornography is very stimulating and often men have difficulty creating that same level of arousal or stimulation with their partners.  Consider masturbating without technology as visual images in your head are less stimulating then watching something live. Try this for two weeks and see if your erection quality improves.
In the Massachusetts Male Aging Study (MMAS) among a community-based survey of men aged 40-70 years, 52% of the men reported some degree of erectile difficulty. Complete ED, defined as the total inability to obtain or maintain suitable erections during sexual stimulation, as well as the absence of nocturnal erections (normal erections [four to six/night], which occur during sleep), occurred in 10% of the men in the study. Lesser degrees of mild and moderate ED occurred in 17% and 25% of participants.
MalaCards based summary : Impotence, also known as erectile dysfunction, is related to vasculogenic impotence and hyperprolactinemia, and has symptoms including angina pectoris, pelvic pain and tremor. An important gene associated with Impotence is NOS1 (Nitric Oxide Synthase 1), and among its related pathways/superpathways are Response to elevated platelet cytosolic Ca2+ and Platelet homeostasis. The drugs Methyltestosterone and Testosterone have been mentioned in the context of this disorder. Affiliated tissues include prostate, spinal cord and endothelial, and related phenotypes are normal and reproductive system
If PDE-5 inhibitors are not suitable or don’t work, other therapies include injections into the base of the penis, which cause flow of blood into the penis and a fairly immediate erection that lasts around an hour. The drugs injected are alprostadil (Caverject and Erectile dysfunctionex) and Invicorp (VIP and phentolamine). Alprostadil may also be inserted as a gel into the opening of the penis. This is not suitable if your partner is pregnant.
"For men who are unwilling or unable to self-inject alprostadil, the FDA has approved this dissolvable pellet that can be inserted directly into the urethra, the opening of the penis," says Dr. Feloney. MUSE, with an inspiring name that actually stands for medicated urethral system for erection, will trigger an erection in about 10 minutes that may last as long as an hour. Using MUSE to treat ED can result in somewhat unpleasant side effects, however — including an aching sensation, burning, redness, and minor bleeding.
Several medications can interfere with the chemical processing of PDE5i medications by the liver. These can include ketoconazole (an antifungal medication known by the brand name Nizoral), erythromycin (an antibiotic), and cimetidine (also known as Tagamet, for reducing stomach acid). A lower dose of PDE5i medications should be used if one is taking any of these medications.
Sexual stimulation causes the release of neurotransmitters from cavernosal nerve endings and relaxation factors from endothelial cells lining the sinusoids. NOS produces NO from L-arginine, and this, in turn, produces other muscle-relaxing chemicals, such as cGMP and cyclic adenosine monophosphate (cAMP), which work via calcium channel and protein kinase mechanisms (see the image below). This results in the relaxation of smooth muscle in the arteries and arterioles that supply the erectile tissue, producing a dramatic increase in penile blood flow.
Alprostadil is injected into the side of penis with a very fine needle. It's of great value to have the first shot in the doctor's office before doing this on your own. Self-injection lessons should be given in your doctor's office by an experienced professional. The success rate for getting an erection firm enough to have sex is as high as 85% with this treatment. Many men who do not respond to oral PDE5 inhibitors can be ‘rescued' with ICI.
×