Practice allowing yourself to like things but not want them. We can have thoughts and feelings, but to act on them is an entirely different manner.

Practice increasing positive qualities and pursuing spiritual happiness such as giving and helping others. The more you see the joy that comes from these things, you simply won’t be interested in the more coarse pleasures like masturbation or sex.

Practice meditation on a daily basis, the more you are present in a moment to moment basis, the quicker you will see sexual desire arising, and be able to stop it before it snowballs in overwhelming thoughts, and feelings that catapult into actions. With more refined mindfulness you will also be able to observe the link between different degrees of feeling such as a pleasant feeling versus an unpleasant feeling and cravings. Most people see the two (feelings and cravings) as inseparable, but once there is a pleasant feeling, cravings may immediately follow and once there is an unpleasant feeling then the desire to get rid of it arises.

But if we meditate and ponder on things, then we can watch carefully and see how the whole thing unfolds. We can see how we come into contact with a sense object and this object can illicit a feeling of either pleasantness or unpleasantness, and we can just leave it at that. By just observing, “this sensation is pleasant” and “this sensation is unpleasant” without adding anything else on top such as cravings, we can control our desires and lust. So, when your eye meets a desirable form like a lady on the street or a sexy lingerie ad, you can just note “pleasant sensation arising” and be rid of the cravings/lust.

Just as young Bikkhu Sumedho sat with his teacher Ajahn Chah in front of plenty of young beautiful women in a talk, at the end of the talk Ajahn Chah turned to him and said “What did that do to your mind?” And Sumedho merely replied “I like, but do not want.” And Ajahn Chah was quite pleased with this answer.