I guess it is a matter of changing one's outlook 'overall'. I am not a pessimist per se, however I was raised in extreme chaos and abuse, and I now have PTSD, and worry about so many things. I overthink everything, think ahead of what will happen that could be 'wrong', etc. I worry about how 'I' am wrong a lot, or how others will reject me in new situations or jobs etc. It really sucks b/c I was taught over time, that I myself was bad, and that the world was bad too.
However, I do try to say to myself, 'You are magnifying this' if I am overthinking. or, 'It will be fine.' and try to reason things out w/myself. I remember sometimes a quote by a wonderful author too , Byron Katie, that is now my favorite quote. 'Nothing is true.' It can instantly calm me when I'm panicked or thinking the worst.
Another of her quotes is 'Reality is always kinder than the stories we tell of it, but only always.'
I guess it comes down to recognizing HOW we are thinking and then saying...'You know, this isn't true. There is another way and another path right now.'