Many have found deliverance and freedom by the Lord's power. Just one testimony is that of a Christian who had prayed and sought the Face of the Lord for many years about this, believing Him for deliverance. She knew in that instant that the Lord has set her free. There are certain helpful steps. Recognise it as sin.
Truth always sets free.
Once you recognise masturbation as sin, you can deal with it as you would any sin. Desire to be free. Recognise your need for help from the Holy Spirit. You cannot break free of this habit by yourself. Will-power is not the solution.