If a person in the age above 40 years develop erectile dysfunction
then there could be medical reasons behind it like diabetes or hypertension
But if a young person at the age of 24 years,like you,develop erectile dysfunction,it is always due to psychological reasons or alcoholism
Do regular exercises
Shed your weight if overweight
Stop alcohol and smoking,if any
Have healthy foreplay with your wife or girl friend
Take your sexual partner in self confidence
Do regular meditation
,yoga and deep breathing exercises.
There is no reason to get tensed as erectile dysfunction is very common in today's world of stresses and tensions.
Approach this problem with patience,you shall succeed gradually.