Hello,
Erectile dysfunction ( ED ) is a very common problem now and when it takes place in young people below the age of 35,it is mostly a psychological problem.
Stress ar work,late night work,differences with your colleagues and wife,financial troubles,guilt regarding extramarital relations etc have a very big role in causing ED.
Other factors which are responsible for ED may be heavy smoking,
alcoholism,using drugs,obesity,lack of exercises,sedentary life etc.
In older people lifestyle diseases like
hypertension,
diabetes,hypercholesteremia may also cause ED.
Since you have not mentioned your age,you have to decide what factors are operating for you.
Do...
Shed weight.
Do regular exercises
Quit smoking and drugs,if any
Moderate your alcohol
Do regular aerobics exercises for 45 minutes a day.
If having any disease,as mentioned above,control it properly.
As far as
masturbation is concerned,it perfectly normal if it is done occasionally on arousal and don't attach any guilt with it.
Night fall is also a perfectly natural phenomenon and do stop worryingl about it.
Eat healthy and avoid junk foods.
Best of luck
Thanks