There's an app on the app store called Brainbuddy. It's an app that helps you abstain from porn and masturbation. I recently downloaded the app less than a week ago and I'm already on day 5 of noFAP or porn. This is coming from a guy who has been masturbating twice a day (first then when I wake up, last thing I go to sleep) for YEARS.
There's a 7 day free trial, try it out and download it. There are other apps on the app store but this is the one that I'm familiar with and so far, it's been amazing. I also go to bed when I'm tired, instead of going to bed whenever and exercise has helped that out (been working out 1-3 times a day for the past month).
I probably will relapse in the future as it's statistically more likely to happen than not, but that's okay with me. I just have a hard rule to not masturbate to porn at all, it has to be with my imagination or NSFW audio i.e. the subreddit named audiogonewild or something like that.
Also have some extensions on my phone and PC that don't allow me to surf NSFW websites so that helps.
All in all it is possible to work on this, and if you relapse that's fine. Part of the human experience is sex, as long as you're not going overboard with it.
But MY stance on MY belief is masturbation is fine, don't masturbate more than once a day and only to my imagination or audio or any porn that you made with someone else.