Something I have done and continue to do to deal with negative thoughts is a technique often referred to as counterbalancing.
It goes like this:
You get a negative thought. In this case the thought is “Man, I really hate my job I just can’t believe I’m stuck here doing this for the next 20 years. Life really sucks”.
You write the negative thought in your journal. This itself is a good step because you are taking the thought out of your head and placing it on paper where you can see it and look at it objectively.
Next, you write three reasons why the thought isn’t true or at least is skewed thinking.
#1 I may not like my job but I am still lucky to have a job, regardless of how I feel about it emotionally and as someone who lives in the West with a job, this puts me in the top 10% of richest people in the world.
#2 I am not stuck in my job. There are always options to explore. I can sign up to job email alerts, I can explore options for training, I could even take a pay cut to change career temporarily (I actually did this).
#3 Nothing is going to be plain sailing, life will always have challenges. A few weeks ago, I had a really good day at work and actually enjoyed working on our new processes. This shows me that there are elements of my job that I do like. I am going to see how I can tap into the things I like about my job more.
If you were struggling at work, this thought might come back but the more you counterbalance it, see it for what it really is, the less hold it will have over your life. Over time you will start to see that a lot of the thoughts we have are skewed and they will affect you less, some will change and some will even go.
The second thing I’ll leave you with is building positivity into your life - uplifting people, media (books, music, TV), consciously choosing the influences you let into your life rather than being subject to random things influence you, will dramatically improve your overall mental health.