Erectile dysfunction (ED) is the inability to get or keep an erection firm enough for sex. It can have many causes, such as physical, psychological, or lifestyle factors.