Just be aware thinking is happening and carry on. That doesn't mean you can't be aware of the content of the thought and the motivations behind it but if you start analysing or trying to solve it you are only going to cause it to snowball, whereas if you stay with the process of thinking you gain the objectivity and over time start letting go of the unwise motivations that fuel your thoughts.
"Proper effort is not the effort to make something particular happen. It is the effort to be aware and awake each moment." - Ajahn Chah
"When we see beyond self, we no longer cling to happiness. When we stop clinging, we can begin to be happy." - Ajahn Chah
"Know and watch your heart. It’s pure but emotions come to colour it." — Ajahn Chah