Keep busy. Find something to devote yourself to, idleness is the main cause for the manifestation or these urges. The gist would be that when your male life force is not put to use, it's going to seek the path of least resistance for release.
Doesn't matter much what it is, whether it's a mental or more concrete endeavor, simply keep yourself in motion. Read shit, study, educate yourself, practice introspection or meditation or any mental discipline, work out, even clean your place. All of these things essentially fortify your mind and resolve since you turn away from distractions. All in all, stomp self-indulgence into the ground, as much as you can, without overdoing it or you'll just relapse. Find your rhythm. Push yourself at a steady and incremental pace, and when taking part in leisurely stuff be mindful of yourself least your bad habits kick back in.
It may seem like too big of a deal, but this is where the problem stems from in the first place. If you pursue this path you'll realize it for yourself sooner or later.
Also the other obvious advice is if you don't have a will of steel, and you in all likelihood don't yet, stay away from all stimulation, especially visual. Avoid thots, avoid sites that display imagery of any kind (so be wary of imageboards), any of that shit. The longer you go with abstinence, the easier it gets. Your mental landscape will change, your habits will change, even your body will change, I'm sure you know about the cap with the anon talking about testosterone rates.
Most of this shit you're likely aware of already but a reminder doesn't hurt I reckon. The big point is to keep yourself busy.