I want to quit masturbation and involuntary sperm ejection at night. Please help

How to prevent sperm discharge during sleep?