Most will agree that optimism and pessimism are two sides of the same coin, let's understand why? When you are excessively optimistic, you fail repeatedly as you try to achieve unrealistic goals. Soon the repeated failures make you pessimistic as a success recedes in your distant memory, with my experience, I would agree the best way to balance optimism and pessimism is by developing realism and lead a balanced and reasonable life. Look at the example, if you observe a poor person, who can barely make his ends meet - his or her way of speaking, body language, choice of words, morals, ethics are in sheer contrast with someone who has a reasonable amount of money to flaunt and has a decent life. Mind you, both are humans and yet they seem so different in every aspect and are born into this unforgiving world in the same way. Also note, a positive person who expect negative outcomes, because of the past experiences, they don't expect good things, because of the fear that they might get hurt in the end, so it is a kind of defence mechanism. However, optimists refuse to put up with them, because such people are really good at stealing your peace of mind and pessimists come across as 'negative' because they focus on 'reality' and on other hand optimists are perceived as 'positive' because they focus on feel-good emotions. Pessimists usually turn out to be 'right' because you can't wish reality away with good feel aspirations and sentiments.
To conclude, let's look at the famous quote : "Optimism is a strategy for making a better future cause unless you believe that the future can be better, it's unlikely you will step up and take responsibility for making it so. If you assume that there's no hope, you guarantee that there will be no hope.” - not a fairy tale though, but how true.
