Unfortunately this a very great sin and its addictive. I have few important questions for you and want to know if you are single or married?
Best ways is to remain in wudhu and feel the presence of Allah swt in your life at all times.
Doing real and sincere Istighfaar to Allah swt.
You need to be self vigilant of your actions.
Also try and utilise your time in doing Godly works.
Try and be in the presence of people around you so you can completely stop doing this sinful act. There's a lot of darkness in the soul if one continues with this sin.
Whether you ejaculate or not, this is psychologically and spiritually very very harmful to your mind, soul.
please refrain from this completely.
Recite Quran and reflect upon the verses. Remember God is watching your actions. Divert your attention and seek positive efforts.
Seek Istiaadha and prayers from Allah swt