This isn’t all that surprising. When you feel blue and low on energy, it can be extremely difficult to perform at your sexual peak. Furthermore, depression is linked to changes in your brain chemistry and nervous system. Some of these areas also affect your sex drive and ability to have an erection. This means that depression can change the way your brain works, making ED more likely.
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.
Associated morbidity may include various other male sexual dysfunctions, such as premature (early) ejaculation and male hypoactive sexual desire disorder. The NHSLS found that 28.5% of men aged 18-59 years reported premature ejaculation, and 15.8% lacked sexual interest during the past year. An additional 17% reported anxiety about sexual performance, and 8.1% had a lack of pleasure in sex. 
VED involved placing the penis in a clear plastic tube where negative pressure created by the vacuum pump leads to penile engorgement and tumescence. Usually a constriction ring can be placed on the base of penis following penile engorgement. Some men complain of bruising, a “cold” penis and pain associated with the constriction ring; however, in some men with NED sensation may not be intact mitigating the side effects of VEDs. VEDs have reported effectiveness up to 90% in certain ED populations and it remains a non-invasive means to achieve and erection.
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.