Many people have heard philosopher Rene Descartes' famous line, "I think, therefore I am." Experienced meditators know there is more to the story. We are, even when we stop thinking. We are not our thoughts.
Thoughts are only as important as we allow them to be. We choose which thoughts to make important by our attention to them. Some thoughts feel better than others. If a thought feels bad to you, then it is not your personal truth. Negative thoughts feel bad because they are discordant from your higher truth.
Cognitive Behavourial Therapy (CBT) is an excellent way to learn to catch negative thoughts that don't serve you, and replace them with better-feeling thoughts. The first (and maybe the biggest) step is to notice your negative thought. When I first read David Burns' book Feeling Good, I had a tendency to fall all the way down to suicidal thoughts before I realized that my thinking was negative and unhelpful. I did that a few times before I started being able to catch the negative spiral as it began. It is all about practice. Practice, practice, practice.
You are not your thoughts, but your thoughts do affect you and your health. The key is to remember that you are not at the mercy of your thoughts. You can start by not taking them so seriously, and progress to challenging them and then changing them. There is always more than one way to look at something, and usually our negative thoughts are not in fact true.
For me, I found that a useful attitude towards my negative thoughts was scorn. I was scornful of my negative thoughts, because I knew that they were unhelpful and not really who I am. Nowadays I do not have to be so heavy handed with them, and I generally chuckle when one comes up.
There are many ways to approach changing your thoughts. David Burns' book Feeling Good is the classic book on CBT, and takes a very rational and formalized approach. A similar but pared down approach is taken by Byron Katie with her process The Work. Abraham-Hicks also offer a variety of ways to change your thoughts that are more based on your feelings. I still think Ask and It Is Given is a good book to start with on their materials.
You are not at the mercy of your thoughts. You can start to change them right now.
Cognitive Behavioural Therapy