“Now the mind of the flesh [which is sense and reason without the Holy Spirit] is death [death that comprises all the miseries arising from sin, both here and hereafter]. But the mind of the [Holy] Spirit is life and [soul] peace [both now and forever].” Romans 8:6 (Amplified Bible)
Neil Anderson observed: “The moment you are tempted to get your need met in the world instead of in Christ, you are at the threshold of a decision. If you don’t immediately choose to take that thought “captive to the obedience of Christ” (2 Corinthians 10:5), you will begin to consider it as an option. And if you begin to mull it over in your mind, immediately your emotions will be affected and the likelihood of yielding to that temptation is increased…
“For example, a man sees a pornographic picture and is tempted toward lust. He has the opportunity to respond by saying something like, ‘My relationship with sin has ended. I choose to take this thought captive to the obedience of Christ. I’m not going to look at it or think about it.’ And he separates himself from the picture immediately and escapes the lust.
But if he hesitates at the threshold, stares at the picture, and begins to fantasize about it, he will trigger an emotional landslide producing a physical response which will be difficult to stop. He must capture the tempting thought in the threshold or it will probably capture him.” 
The booklet, A Study of the Mind, also teaches the relevance of this principle–that victory over temptation is gained at the threshold of the mind, not in the mind.” 
The author of At The Altar of Sexual Idolatry confirms this wisdom in his testimony: “I overcame temptation because I refused to allow myself to dwell on sexual thoughts. When a fantasy entered my mind, I would make the conscious decision not to entertain it. The person who affords himself the luxury of savoring a fantasy is setting himself up for a huge fall. The time to deal with temptation is when it first appears. The longer the thought lingers, the more difficult it is to resist.” 
By the enablement of the Holy Spirit we can be renewed in the spirit of our mind (Eph. 4:23).
 Daily in Christ, 3/26. Emphasis added
 Preston Gillham and Anabel Gillham, A Study of the Mind (ebook) https://www.lifetime.org/store/a-study-of-the-mind-ebooklet
 Steve Gallagher, At the Altar is Sexual Idolatry, p. 95