Jesus knows very well the struggle you’re in. The Bible says He was tempted in all points as we are. The Holy Spirit knows you through and through. He lives in you, and He was sent to guide you and comfort you.
God is with you, and He knows the struggle is great. He fights with you, side by side. This view of God keeps shame away, but it leaves us room to keep a proper caution toward masturbation.
Think hard about this. Obviously, rejecting pornography and fantasy is a baseline requirement. That must be done, because it’s sin. Any sinful form of masturbation must stop as well. While there may be some corners of masturbation that aren’t sin, most of what surrounds masturbation is sin and binds us to the point of strangling us spiritually and emotionally. We must face that truth like men, rejecting shame and choosing manhood.