Move a muscle, but we're not talking about your biceps. A strong pelvic floor enhances rigidity during erections and helps keep blood from leaving the penis by pressing on a key vein. In a British trial, three months of twice-daily sets of Kegel exercises (which strengthen these muscles), combined with biofeedback and advice on lifestyle changes — quitting smoking, losing weight, limiting alcohol — worked far better than just advice on lifestyle changes.
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.
Diabetes is a well-recognized risk factor for ED. A systematic review and meta-analysis found that the prevalence of ED was 37.5% in type 1 diabetes, 66.3% in type 2 diabetes, and 52.5% in diabetes overall—a rate approximately 3.5 times higher than that in controls.  The etiology of ED in diabetic men probably involves both vascular and neurogenic mechanisms. Evidence indicates that establishing good glycemic control can minimize this risk.
Knowing about your history of ED will help your health provider learn if your problems are because of your desire for sex, erection function, ejaculation, or orgasm (climax). Some of these questions may seem private or even embarrassing. However, be assured that your doctor is a professional and your honest answers will help find the cause and best treatment for you.