A few hours ago while playing a video game I got tempted and was about to give in when it struck me: why not spend the time I am to spend on watching porn and fucking myself (which is a very stressful one I'm sure you'll agree) on finding some funny memes and gifs, and end up laughing, instead of edging, losing myself, and then regretting. Guess what, I went for the laughing and, honestly, it blew off my steam. I know that some of you might find memes and gifs pathetic, but tell me this: Which do you prefer? I believe the answer, then, becomes clear.
Exercise also helps a ton. And gives you a nice healthy endorphin high. But yea, anything to take it off your mind!