Erectile dysfunction (ED) is the inability to get and keep an erection firm enough for sex. Having erection trouble from time to time isn't necessarily a cause for concern. Problems getting or keeping an erection regularly can be a sign of deeper underlying condition that needs treatment and a risk factor for heart disease. Hence, if you're concerned about erectile dysfunction, talk to a doctor at the earliest.