First of all remove all myths & misconceptions from your mind about masturbation
In fact, Masturbation is completely normal & doesn't have any bad effect to the body and mind.
Causes of hair loss/thinning of hair are:
1. Environmental factors
3. Deficiency of certain minerals, vitamins & amino acids in diet. e.g. Iron, zinc, Vit B complex, lysine.
4. Hormonal factors. e.g. Testosterone
5. Any incidence of surgery, shock, etc.
1. Treating the underlying cause
2. Avoidance of stress
3. Dietary modifications
4. Minoxidil solution to be applied locally to stimulate the hair follicles
& multi mineral supplementation
But these medications have to be used regularly under the guidance of a Dermatologist...as hair loss tends to return on stoppage of these medications.
Those cases which do not respond to medical therapy, are managed by hair transplantation
So...it will be better to consult a Dermatologist
to find out the underlying cause & start treatment accordingly.
There is nothing to worry...
Wishing you a Good Health. Let me know if I need to clarify further.
Thanks & take care.