try eating several small meals instead of three large ones whenever you can...Avoid foods that irritate your stomach, especially those that are spicy, acidic, fried or fatty... avoid coffee,tea etc... Avoid Stress as it may make your gastritis symptoms worse...consider calming activities, such as meditation, yoga etc...sleep with head raised position and have dinner at least 2 hours before sleep...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..
Consult nearest physician they will do the needful.