I preached yesterday on purity and one of the main thrusts of the message was encouraging people to "take every thought captive in obedience to Christ" (2 Cor. 10.5). Let me give a narrative example of how to do this.
Jesus returns from 40 days of fasting to a crafty enemy (see Matthew 4 and Luke 4). He starts with the most obvious place: Jesus' hunger. "You can turn these stones into bread. Why don't you?" And then: "You're the Son of God and Your Father doesn't want you hurt. How about show off a little bit?" Finally: "If you want the kingdoms of this world, worship me."
With each temptation, Jesus not only took every thought captive, but also applied Truth to it, quoting from the Bible (specifically Deuteronomy) each time.
How about us?
When I'm tempted to lust, I pray, "Jesus, I'm taking this thought captive in obedience to you. I choose instead to think about what's true, honorable, just, pure, lovely, commendable, what is excellent, what is worthy of praise" (see Philippians 4.8).
When I'm tempted to rejoice in my status or standing: "Jesus, I'm taking this thought captive in obedience to you. I want to be a servant as you were. I want to empty myself and not rejoice or boast in myself. I want to be one of the ones who bow down to you today and serve others because you served me" (Philippians 2.1-11).
I could keep going, but will simply say this: if you're going to fight the fight and win, you have to fight with the Word of God.
But that's just me thinking thoughts...