Isaiah 55:7
Let the wicked leave (behind) his way; and the unrighteous man his thoughts; and let him return to the Lord, and He will have compassion (mercy) on him, and to our God for He will abundantly pardon.
We can get off track when we let our thoughts wander without supervision. We don’t have to accept everything that comes into our heads. What we think about is where we will go, and we can control our thoughts. God knows this, so when we are determined to change, He will help us.