Hello,
There are various causes for ED which includes physical causes like diabetes,
hypertension etc and psychological causes like stress,anxiety,disturbed sexual relation,extramarital affairs,overwork and busy schedule etc and causes like smoking,obesity,
alcoholism,
drug abuse,lack of exercises,lack of sleep etc.
Treatment includes regular aerobic exercises,reduction of weight,no to smoking and alcohol,avoiding junk foods and fried foods,consumption of more of fresh fruits,yoga,
meditation and deep breathing exercises.
You shall be all right in next 6 months with these measures.
Remember the reason is generally psychological in young people like you.
Thanks