Breakfast with Solomon - Proverbs 23:26
"Give me your heart my son, and let your eyes delight in my ways"
The battle against temptation is a battle for the mind.
The battle against lust is also a battle for what will the mind delight in. If you do not have godly things to delight in and allow your mind to fantasize about harlots and sexual perversions, then you will have no chance of winning the war against temptation.
The word heart in the Hebrew is the seat of the thinking, the will and the emotions. This is clearly the mind in modern day vernacular. They saw the mind as a controller of the impulses of the heart, the liver, the kidneys, and the bowels.
The Lord is clearly imploring the believer to deposit their mind with Him and not build sexual fantasies in their mind. Take delight in the ways of God. Those could be in nature, those could be in righteousness, those could be in justice through good government, those could be through church, those could be in any number of ways in which God works and wants to work. We should build fantasies of righteousness and wisdom and not plans on how to violate the 7th Commandment. It is not only wrong; it sucks the life out of the developer of those fantasies.
The battle against lust cannot be won until a whole new way of thinking is developed and implemented. You have to have a place for your mind to go. It is not sufficient to suggest that one should stop thinking about a particular idea. One has to have something else to think about. The best ideas to think about, rather than lust and violations of God's moral code, are Godly ideas that bring delight to your mind. It is no use to try and think about things as a block to lust that you have no delight in. You must be excited about this righteous idea. It must be playing to your mental, emotional, and physical wheelhouse so you can drive this idea out of the park. Everybody has different ways of fantasizing about moving the righteous and good forward. It is that that should be used as a block to the temptations of lust.
The New Testament reiterates this concept in a number of places; the most famous is Philippians 4:8: Finally, brethren, whatever is true, whatever is honorable, whatever is right, whatever is pure, whatever is lovely, whatever is of good repute, if there is any excellence and if anything worthy of praise, dwell on these things.