Is it common for a 24 year old to have problems getting erect and if it's erectile dysfunction what should be done?

Find out why. It's common for every guy to have erectile dysfunction or impotence once in a while. It's even more common for older men to have issues regularly as we age but it isn't common in younger men. So if it's a recurring issue, get checked out & find out why. Any new stress? School? Job? Money? Relationships? Family? Are you happy w/your partner? If none of above, talk to your family doc about health.
Find out why. It's fairly common due to shyness or inexperience, but less common medical causes need to be ruled out. So the first step is a general medical checkup. If everything is medically ok, talking to a psychotherapist or sex therapist may help. (note: sex therapists talk to patients about sex, there's no touching or sex in the office.).