Where is the best place to be when temptation comes? In God's will. Luke 4:1 tells us that Jesus was "led by the Spirit into the wilderness." Jesus always was in God's will, but sometimes we aren't. We put ourselves in places we don't belong. We hang out with people we shouldn't hang out with, and then we end up doing things we shouldn't do.
Psalm 1:1–2 says, "Blessed is the man who walks not in the counsel of the ungodly, nor stands in the way of sinners, nor sits in the seat of the scornful." Note the progression in these verses from walking to standing to sitting. That is how temptation works.
It is like being on a diet and deciding to walk by your favorite bakery. Predictably, you spot that fresh cinnamon roll on display in the window. So you go from walking to standing. Then you are looking. The next thing you know, you are sitting in the bakery's vat, eating raw dough.
Or, you are with the wrong people, walking "in the counsel of the ungodly" or standing "in the path of sinners." They say to you, "Oh, would you relax? You are so uptight with your Christianity. Come on. Have a drink. What is one drink?" Or, "Hey, come with us and do this. It's just this one time. Oh, come on! Have a little fun!" And suddenly you find yourself in a place you shouldn't be. You think, How did I get here?
You were in the wrong place with the wrong people at the wrong time.
That is why the best place to be when temptation comes is in the will of God. And that is why we need to keep up our guard and fill our minds with God's Word.