A post from the "talk-backs" of Arutz Sheva, on Tzvi Fishman's Blog.
Yehudah from Jerusalem writes:
I know what you are going through for I have been there and have overcome it with a lot of work and determination to succeed. You can succeed as well.
- The first thing you have to do is to find a Torah project to be studying,
- (Second) Humility. Moses was great on this one, he was close to Hashem; and being close to Him is great.
- (Third), memorizing T'hilim especially the ones that mean a lot to you (for me, 125, 86, 25, 100, etc) or any other Torah subject that you feel would help you grow to become holy. KEEP THESE MATERIALS WITH YOU AT ALL TIMES (excluding bathrooms) and read/study them whenever you get the urge to masturbate or when sexual thoughts come to you.
2. Don't look at nor think about anything or anybody who evoke sexual desires. Get rid of all your porn books/pictures/movies, etc. Give up TV programs, for the adds are nothing but sex. Throw away all sex objects. In fact, throw away all clothes that have seaman spots on them. I say this in terms of the fact that they are memories of coveting, lust etc, and these memories have to be out of your house and off your body. The same applies to bed covers and mattress. After this, wet dreams are the thing of the past.
3. Don't think that marriage is going to put an end to these coveting/lust desires. If you have not broken and replaced the memories/desires of p-orn and lust, then having sex with your spouse is nothing but the same, for you will be thinking of someone else and this can spoil your marriage relationship. Once you start getting the midlife spread, you'll be looking around at other people to arouse your sexual desires and you may as well have been performing adultery for you have it in your heart. If you realize this then your marriage relationship will grow more into love and not just sex.
4. This whole project is a constant effort, for sex is around you where ever you go; so you have to be strong and take courage that it can be done, for others have succeeded. I have succeeded, thank G-d, but there are always new temptations. You will need to learn to be aware of yourself and your feelings/thoughts so as not to become distracted.
5. The answer and help to this entire effort is found in the Kriyat Shema. Say it very slowly and with all your heart.
May Hashem Guard you.