Replace it with a good habit. Easy, right? Well, it depends.
When I was a kid, I had to deal with overt racial tension in school. So, life wasn't easy. I had learned to cope by waking up every morning before school to ruminate on how the day would go. I believed that if I could imagine the worst, it will help make the day go better.
But, what eventually happened was that this practice cultivated a sense of dread for each day, especially, when unexpected or painful circumstances happened anyway. I learned to build up and nurse resentments. I plotted and planned revenge, or imagined the worse in other people.
After becoming a young adult, I didn't rely so much on imagining how my day would go — as if it would magically make my day go better. Rather, I got up in the morning wondering if I would ever find love and happiness. That became my new obsession, which often led to depression or distraction. I thought of different scenarios from the previous day, and ruminated on how I could have done this or that better. Or I would angst about what went wrong in my pursuit of love and happiness.
It wasn't until I became a Christian that I developed a different use of my time in the morning. I would get up to pray and read the Bible. My thoughts were on God, His will in this world, and how I fit into it. At first I did this because those who were in Christ longer than I was suggested I do this, and it was, practically, the best time for me to do my thinking and meditating.
What developed became a habit of its own. I valued my time with the Lord, and it grew into an eager expectation. Unintentionally, I found I didn't have as much time to think about how I can control my life through visualizing my desires. And my thinking became much more healthy. In other words, my mind was being renewed.
This isn't a magic formula. Changing bad habits isn't easy or quick. But, when we continually practice good habits, we can start to replace those bad habits. And here is the truth: The habits we value are the habits we stick with. Taking on a good habit that is truly important to us will cause some bad habits — intentional or not — to naturally be replaced. This is because time is limited, our energy level is limited, and our resources are limited. When we have found something that is worthy of our dedication, we will make room for it. And the bad habits we don't value as much will often get starved in the process.