We cannot control the thoughts that come to us, but we can choose how we react to them. Today, try viewing your thoughts as clouds passing through the sky (our mind). Just watch. In a non-judgmental way. Let the observer in you watch them come, pass through, and eventually disappear.
Even the clouds that look stormy come and go. And if we see thoughts as neutral matter and not as "good" or "bad," we don't give them the power to control us.