But you can be amazed at what has happened throughout the whole history and what humans have built, and be optimistic and excited about the future, and that we can handle the problems thrown at us and be completely realistic at the same time.
And even if there was some way to accurately judge whether optimists or pessimists view the World more accurately, it doesn't mean you can't still view the world accurately and be an optimist at the same time.
It might just be that optimists on average are more likely to view things in a better light than they are, but it doesn't apply to every single optimist.
There is truth, but also even bad truth like a problem coming your way you can treat it as an exciting challenge or a nuisance.