Sometimes our minds get thinking about things that bring temptation and problems into our lives. The Bible tells us what to think about in Philippians. When our minds start to wander into places we should not go spiritually, think on these things.
This is a good verse to memorize.