Nerves originating in the spinal cord and peripheral ganglia innervate the penis. There are autonomic (parasympathetic and sympathetic), and somatic separate and integrated pathways. The autonomic pathways neurons originate in the spinal cord and peripheral ganglia from the sympathetic and parasympathetic systems, respectively. They merge to form the cavernous nerves that travel alongside the prostate, enter the corpora cavernosa and corpus spongiosum to affect the neurovascular events required for tumescence and detumescence. The somatic nerves send sensory information from the penile skin, glans, and urethra via the dorsal penile nerve and pudendal nerve to the spinal cord. The somatic nerves also initiate contraction of the ischio- and bulbocavernosus muscles.
The causes of erectile dysfunction include aging, high blood pressure, diabetes mellitus, cigarette smoking, atherosclerosis (hardening of the arteries), depression, nerve or spinal cord damage, medication side effects, alcoholism or other substance (drug) abuse, pelvic surgery including radical prostatectomy, pelvic radiation, penile/perineal/pelvic trauma such as pelvic fracture, Peyronie's disease (a disorder that causes curvature of the penis and sometimes painful erections), and low testosterone levels.
There are so many potential reasons a man might develop erectile dysfunction (ED), it's nearly impossible to generalize the best ways to treat it. What works for one man may not work for another simply because they are having problems for different reasons. That said, it may encouraging to hear that there are a variety of options that may be considered, from psychological counseling to lifestyle changes, medications to treatments and devices.