It is possible that you may have an underlying depressive disorder from what you described as negative thoughts and pessimism is a symptom of depression, but in order for an official diagnosis, you would have to see a psychologist or a psychiatrist face to face. The best way to treat an automatic negative thought process is through Cognitive Behavioral Therapy (CBT). CBT has a premise that your symptoms are caused by negative thoughts, so if we change your thought process to be more positive and objective, then your pessimism will lessen as well. CBT gradually changes how you think to see things more objectively, so you can still have the negative thoughts, but you also have to consider the positive ones as well and then you will rationally pick which is one is the more probable. Here are some examples of CBT techniques if you want to learn more about them.
So this link may help you, it contains a technique I use with patients called a thought record. It will help you keep track of any negative thoughts you have. You put the negative thought on paper, the emotion accompanying, the evidence to support it, and the evidence against it. Then I want you to come up with an alternative thought for the situation (more objective and plausible). This will help you change your way of thinking to be able to think more positive and not automatically go to a negative type of thinking.
In addition, these two worksheets are very good at helping to lessen negative type thinking. It can help you focus on the big picture and the objective/positive thoughts and outcomes.
In addition, here are a couple free CBT websites that you can use as well to help you gain more understanding of how this process works and to incorporate it in your daily life.
Of course if you feel these self-help techniques are not enough than seeing a psychologist for therapy would be best so that you can get individualized CBT treatment to help you overcome this issue.