I forgot to mention I'm 28 years old and at a healthy weight.
Erectile dysfunction can develop in young adults due to a variety of causes. Psychological stress, performance anxiety, depression, neurogenic disorders peyronie's disease, body image issues, medications, alcohol, smoking, drugs/medications, hormonal imbalance, radiation therapy, kidney failure, metabolic disorders, multiple sclerosis, hypertension, diabetes, prostatitis, urethritis etc. just to name a few. Anxiety and stress play an important role in the development of erectile dysfunction; and is the most common possible cause. At a primary level, I would suggest being a bit relaxed and working on the psychological factors. You could also see a psychotherapist/ behavioral therapist for the same. It might also be beneficial to get rid of factors like smoking/ alcohol/ drugs, if involved. In case this doesn’t work, I would suggest seeing a urologist for an evaluation of the above mentioned causes and appropriate specific treatment.
Hope this helps.