I've recently been preparing a talk on Daniel 1 through our church's series on Temptation and our need to "Just Say No". The verse I continue to come back to is Daniel 1:8 where he chooses to do it God's way at a great risk to his future and life. It is there in that verse we learn that Daniel had "resolved not to defile himself" (purposed in his heart - KJV). This verse tells me that Daniel had already won the fight in his mind/heart long before he was confronted with this specific temptation.
This simple phrase is a reminder to me that the battle against temptation is won in our minds. If we are all honest, there is a battle raging daily within our minds as we face a multitude of temptations. My response (your response) is going to greatly hinge on what I'm (we are) filling our minds with. We need to be asking "Is my mind/heart in a place of submission to God and am I thinking about the things of God so as to give myself a better chance at standing up strong against temptation?" I am coming to truly learn (more than just head knowledge) that temptations will draw out of me a response that is greatly dependent upon what is already floating around in my head/heart. Luke 6:45 is true in the sense that whatever is going on inside will eventually make its way out, especially in moment's of decision when tempted.
With this in mind, I'm determined yet again to live out Philippians 4:8. I am determined to think upon the things God wants me to think upon so that when faced with temptation, I will respond in a Christ like fashion. I want my Christ like response to honestly reflect what's already happening in my mind/heart because of what I've chosen to fill it with. I think we need to regularly ask ourselves "What I am regularly filling my mind with?" The answer to that question will give you a pretty good hint at how you will fight/overcome temptation.
So think upon these things:
Whatever is True
Whatever is Noble
Whatever is Right
Whatever is Pure
Whatever is Lovely
Whatever is Admirable
Anything that is Excellent or Praiseworthy