Smoking, beer/ale, boozing, drugs etc any of these can interrupt blood flow to your penis resulting in diminished libido and can cause erectile dysfunction in men. Stress, anxiety, depression, fatigue, crappy diet, lack of exercise, and some medications can also cause malfunction at the junction. But not to worry there are medications in market which can treat ED.