you need google erectile dysfunction
to get a full description (over 20 different ways to cause erectile
If you suspect to have it, you need to visit a doctor so they can determine if it is physical or psychological problem. It's usually psychological or it could be the combination of physical or psychological.
Usually men over 40 that experience erectile dysfunction relates to a physical problem or some underlying medical condition, ie. diabetis, high blood pressure, etc.