You need to go to confession at least once a week. I am in your same situation. I, for most of my life, have masturbated and these past few years, almost daily until this year. I came into the church after being an atheist and am now trying to live a celibate life. I was so addicted that it was ruling my life. After I found out that I was committing a grave sin by masturbating I tried to stop. I went to confession a couple times a month but, still couldn’t go more than a few days without masturbating or looking at pornography. However, since I now knew what I was doing was wrong it made me feel bad. Every time I went to confession and then, sinned again I always felt so bad. In fact the guilty feeling only got progressively worse with each time I did it until I reached a point where I couldn’t take it anymore and I felt just about like laying down and dying. BUT, I knew, after 6 months of battling this thing and weekly, sometimes twice a week confession that I had the power to stop if I really wanted to and with the help of God’s grace and infinite mercy. So, I dragged myself to confession again and it has now been 2-3 weeks since then and I am clean. Today however, I have been tempted to start up again but, I now know that I have been given the grace from God to quit and never do it again and you know what? I am not going to.
I know how frustrating it is and how hopeless it feels at times but, if this is a serious issue for you, then you will only be able to conquer this sin with weekly confession and a sincere desire to change your life. A true contrition is a genuine sorrow that you feel from sinning not because you are afraid they will send you to hell but, because your sins have offended God. Once you have reached a point where you feel true sorrow for your sins for the sole reason that they offend God, you have true contrition. True contrition, however, is a supernatural gift. It is different from natural contrition, sorrow we feel for everyday things. True contrition is something you have to ask the Holy Spirit to grant to you, and believe me, He wants to give it to you.
If you have McAfee on your computer, you can block adult websites and anything else that might be a near occasion of sin. If you have firefox, there is an add-on you can download for free called BlockSite and it works well too. But, you cannot rely solely on programs to keep you from sin, you have to make a sincere effort to stay away from even the smallest things that have even a possibility of leading to sin (online clothing stores because of the models, especially underwear; random blogs, google images, etc. ANYTHING that might be a pathway to a sin.). If you ever feel like you have even the slightest urge, do not even pick up your computer! And don’t lie to yourself saying “oh, I’ll just check my email…” You know what your real intentions are…
Well, I hope I helped. Just don;t give up. It takes work. God Bless!
