Hello dear,
You are correct regarding the fact that
masturbation doesn't have any bad effect to the body and mind, unless you get addicted to it.
Since you are feeling that your masturbation is interfering with your normal functioning, you can try out the following measures:
1. Improve your social life by spending more time with friends and relatives.
2. Keep your mind active and busy at all times either through curricular or extra-curricular activities.
3. Have a diet rich in fruits, vegetables, fish, nuts & honey.
4. Avoid fast foods & lipid containing diet.
5. Avoid
smoking & alcohol.
6. Keep away
stress, think positive.
7. Exercise regularly & practice meditation
These measures will be helpful in improving your strength, concentration & builds up the confidence level.
Take care.