Singing works very well for me. YMMV.
By the way, it's a lot more helpful to think of your pessimism as learned. You have gotten into the habit of thinking negatively. By becoming aware of this, you have a fairly good chance of changing it. For example, you can, in a positive moment, prepare positive thoughts that you summon as soon as you notice you're getting negative. Writing them down is supposed to be helpful. By reading the positive things you wrote down yourself, you remember that you have another way of looking at things at your disposal, you just need to get used to it.