The thing about optimism is that if you believe there is a solution, you'll keep working until you find it. If you're pessimistic, you're more likely to give up if there solution isn't obvious. Successful people are often optimistic because it's useful.
Don't assume that everything will work out, assume that there are solutions to every problem you face. Even when there aren't solutions, searching gives far more meaning to life than complacency.
There's certainly value in stoicism, but I think optimism results in the best quality of life. Which you choose should be based on your personality and what brings you satisfaction (contentedness vs achievement).