Usually there will not be a specific treatment that will lead to the improvement of erectile dysfunction. However, there are treatments that will allow erections to happen and can be used to allow sexual activity to take place. There are three main types of treatments: non-invasive treatments such as tablet medicines and external devices (e.g. vacuum device); penile injections; or for men who have not had success with other treatments, surgery may be an option.
The mechanisms by which testosterone plays a role in erectile function are not completely understood. A study evaluating the effect of testosterone on erections in surgically castrated rabbits and control animals, in which the rabbits’ intracavernosal pressures were compared after cavernosal nerve stimulation, determined that castrated rabbits had much lower pressures after stimulation than control rabbits did.  Notably, the pressures increased when castrated rabbits received exogenous testosterone replacement.
Vacuum pumps are effective in most men. Successful erections are achieved in up to 90% of men using the vacuum device, however only about 69% men continue to use the device for two years or longer. The most common cause of failure is improper use of or unfamiliarity with the device. Other drawbacks to the use of vacuum devices include the need to assemble the equipment and the difficulty in transporting it. Many men also lose interest in the device because of
Sexual functioning involves a complex interaction among biologic, sociocultural, and psychological factors, and the complexity of this interaction makes it difficult to ascertain the clinical etiology of sexual dysfunction. Before any diagnosis of sexual dysfunction is made, problems that are explained by a nonsexual mental disorder or other stressors must first be addressed. Thus, in addition to the criteria for erectile disorder, the following must be considered:
Of the drugs used for depression, tricyclic antidepressants may be associated with erectile problems and other drugs may be substituted to prevent this complication. Currently available substitutes include bupropion, nefazodone, and trazodone. The selective serotonin reuptake inhibitors (eg, fluoxetine, sertraline, paroxetine, citalopram) can also cause difficulties with ED, but they might also have other significant sexual side effects, including decreased libido and anorgasmia.
Tests such as the bulbocavernosus reflex test are used to determine if there is sufficient nerve sensation in the penis. The physician squeezes the glans (head) of the penis, which immediately causes the anus to contract if nerve function is normal. A physician measures the latency between squeeze and contraction by observing the anal sphincter or by feeling it with a gloved finger inserted past the anus.
Sildenafil is available as oral tablets at doses of 25 mg, 50 mg, and 100 mg. Patients should take sildenafil approximately one hour before sexual activity. In some men, the onset of action of the drug may be as early as 11-20 minutes. It's best for men to take sildenafil on an empty stomach for best results since absorption and effectiveness of sildenafil can be diminished if it is taken shortly after a meal, particularly a meal that is high in fat. Sildenafil and the other PDE5 inhibitors don't cause an immediate erection. Sexual stimulation is necessary for these medications to work.
Exercise and lifestyle modifications may improve erectile function. Weight loss may help by decreasing inflammation, increasing testosterone, and improving self-esteem. Patients should be educated to increase activity, reduce weight, and stop smoking, as these efforts can improve or restore erectile function in men without comorbidities. Precise glycemic control in diabetic patients and pharmacologic treatment of hypertension may be important in preventing or reducing sexual dysfunction. 
SD in MS can be classified into three categories. Primary SD is due directly due to MS-related neurological deficits, secondary SD is related to physical impairments and symptoms or drugs used for MS treatment, and tertiary SD is due to the psychological, social and cultural problems attributed to MS (38). These classifications are important, and underscore the importance of addressing all the issues leading to SD not just the neurologic impairment.
For obvious reasons, ED can be a sensitive subject, one that until relatively recently men were more likely to try to hide than to deal with. Fortunately, a deeper understanding of the variety of causes of erectile dysfunction has led to medications, therapies, and other treatments that can be more individualized and more likely to be effective—and more open discussion about addressing the concern.
ED is a common occurrence after SCI, occurring in up to 80% of men, and results from disruption of the nerve pathways essential for erection (24,25). Different degrees of ED may occur depending on the spinal cord level of injury (LOI), extent of lesion and timing from injury. Reflexogenic erections can occur with lesions above L3 or L4 when the erectile spinal reflex arc remains intact. Psychogenic erections can occur with low lesions in the sacral and lumbar spinal cord but may not occur in complete lesions above T9 that can damage sympathetic outflow. Additionally, reflexogenic erections are not likely to occur in the spinal shock period that occurs after the initial cord trauma. Conversely, their occurrence may signal that the period of shock is over (26). Typically SCI affects younger men in their “sexual prime” and ED is associated with decreased quality of life (27).
The PDE5 inhibitors sildenafil (Viagra), vardenafil (Levitra) and tadalafil (Cialis) are prescription drugs which are taken orally.:20–21 Additionally, a cream combining alprostadil with the permeation enhancer DDAIP has been approved in Canada as a first line treatment for erectile dysfunction. Penile injections, on the other hand, can involve one of the following medications: papaverine, phentolamine, and prostaglandin E1, also known as alprostadil.:25
Several studies accessed the prevalence of ED. The Massachusetts Male Aging Study reported a prevalence of 52%.2 The study demonstrated that ED is increasingly prevalent with age: approximately 40% of men are affected at age 40 and nearly 70% of men are affected at age 70. The prevalence of complete ED increased from 5% at age 40 to 15% at age 70.2 Age was the variable most strongly associated with ED.
However, a review of a United Kingdom medical record database found no evidence that the use of 5-alpha reductase inhibitors independently increase the risk for ED. In 71,849 men with benign prostatic hyperplasia (BPH), the risk of ED was not increased with the use of finasteride or dutasteride only (odds ratio [OR] 0.94), or a 5-alpha reductase inhibitor plus an alpha blocker (OR 0.92) compared with an alpha blocker only. In addition, the risk of ED was not increase in 12 346 men prescribed finasteride 1 mg for alopecia, compared with unexposed men with alopecia (OR 0.95). The risk of ED did increase with longer duration of BPH, regardless of drug exposure. 
All of these medicines work by relaxing smooth muscles and increasing blood flow in the penis during sexual stimulation. You should not take any of these medicines to treat ED if you are taking nitrates to treat a heart condition. Nitrates widen and relax your blood vessels. The combination can lead to a sudden drop in blood pressure, which may cause you to become faint or dizzy, or fall, leading to possible injuries.
ED usually has something physical behind it, particularly in older men. But psychological factors can be a factor in many cases of ED. Experts say stress, depression, poor self-esteem, and performance anxiety can short-circuit the process that leads to an erection. These factors can also make the problem worse in men whose ED stems from something physical.