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.
"Whenever we feel that we are definitely right, so much so that we refuse to open up to anything or anybody else, right there we are wrong. It becomes wrong view. When suffering arises, where does it arise from? The cause is wrong view, the fruit of that being suffering. If it was right view it wouldn't cause suffering." - Ajahn Chah
"Remember you dont meditate to get anything, but to get rid of things. We do it, not with desire, but with letting go. If you want anything, you wont find it." - Ajahn Chah