It takes time. It took time for you to dig the hole and it will take time for you to find your way out. But you can do it.
There’s a group of us here recovering from that same thing. If you search “masturbation” or “porn” or “PMO” you’ll find some. Let me see what else I can find tomorrow.
Also there are some good resources online; Neal made a great post about it a little while back - support groups; recovery programs:
I’ve gotta head to bed now but I’ll check in tomorrow. Be gentle with yourself tonight - maybe make some tea, draw a bath, relax & really help yourself relax naturally - then after a good night’s sleep the world will look better.