Common, treatable, and frequently an early warning sign of something else.
It is mostly a vascular problem
An erection depends on healthy blood vessel lining releasing nitric oxide so smooth muscle relaxes and blood rushes in. The arteries feeding the penis are one to two millimeters across. Your coronary arteries are three to four.
The same disease narrows all of them, but it takes a small vessel out of service first. That is why new erectile dysfunction can precede obvious heart disease by two to five years.
Which means it deserves a workup
If you are under sixty and this has changed without an obvious explanation, that is a cardiovascular risk equivalent. It deserves blood pressure, lipids, an HbA1c and an honest conversation about smoking and weight, not just a prescription.
The other causes
Low testosterone reduces nitric oxide production and lowers desire. Thyroid disease contributes. Diabetic neuropathy and pelvic surgery can damage the nerves involved. Medications are a frequently missed cause, including beta blockers, thiazide diuretics, SSRIs, finasteride and opioids.
Performance anxiety, depression and relationship strain can cause the problem outright or make a physical one considerably worse. If morning erections are still happening reliably, the hardware is largely intact.
About the medications
PDE5 inhibitors, sildenafil, tadalafil and vardenafil, do not create erections. They amplify a signal your body is already producing, so sexual stimulation is still required. Roughly half of apparent failures come down to how the medication was used, and guidelines suggest four to six attempts at an adequate dose before calling it a failure.
They must never be combined with nitrates. That combination can drop blood pressure to a life threatening degree.
If medication is not working
A small number of men do not respond to the pills, and that is worth naming rather than leaving them to assume they are out of options. Penile injections are often a great solution, working in about 95 percent of men, and I prescribe them often for men for whom the medications have failed. Penile implant surgery exists as a last resort, and it is something to discuss with a urologist who performs them. It is not something I perform.