Anyone can experience unexpected episodes of ED at any time, but it is a gradual process.
If ED occurs suddenly, it may be a side effect of taking medication or a psychological episode. The NIDDK says that some medications, including antidepressants and blood pressure medications, can cause ED.