Erectile dysfunction (impotence) is the inability to get and keep an erection firm enough for sex. Having erection trouble from time to time is not necessarily a cause for concern. If erectile dysfunction is an ongoing issue, however, it can cause stress, affect your self-confidence and contribute to relationship problems. Problems getting or keeping an erection can also be a sign of an underlying health condition that needs treatment and a risk factor for heart disease. If you are concerned about erectile dysfunction, talk to your doctor — even if you are embarrassed. Sometimes, treating an underlying condition is enough to reverse erectile dysfunction. In other cases, medications or other direct treatments might be needed.