Thanks for your query,based on the facts that you have posted it appears that you have problem of night emission.
It is normal to get night emission at the age of adolescence and it does not have any negative effect on brain or memory.
Following general measures will help you to boost up your confidence and improve your performance .
1) Practice regular exercise for 45 minutes followed by meditation
for 1/2 an hour in the morning.
2) Take high protein diet rich in vegetables and fruits and Vitamin A
3)Take anti oxidants like Almonds 5-6 everyday..
4) Avoid alcohol and smoking
There are no medications to prevent night emission.