Erectile dysfunction may be due to many causes as many physiologic, hormonal, and psychogenic factors are involved in the ability to obtain and maintain erections... most of the times it will be psychological but other conditions like
diabetes, hypertension, hormonal imbalances and intake of certain drugs can be the cause so these should be ruled out..treatment mainly depends upon underlying cause if its psychogenic counseling with psychiatrist with meditation, yoga etc will help...they may prescribe certain medication as well to maintain erections..if its orgainic cause it should be dealt accordingly
kindly consult psychiatrists