Worry is a very interesting problem. There is specific, limited worry, and free-form, bottomless pit worry. There is functional, motivating worry and useless, immobilizing, soul-draining worry. With worry, less is more.
A pessimistic view of the world can be perfectly functional if it isn't too extreme - a "good" worrier sees the downside and acts prudently to prepare for that downside. A good pessimist sees the flaws in a situation and strives to improve it.
I have a family member who carefully reviews every possible outcome to each situation and assumes that the most disastrous outcome is the most likely. This is often referred to as "catastrophic thinking." If you are expecting the worst possible outcome in every scenario, it becomes difficult to carry on. Worry morphs into anxiety and inactivity, isolation and depression.
Too much optimism can be also very bad. Optimists tend to have an unrealistically positive view of the world and their own capabilities. Optimism morphs into grandiosity and manic behavior. The most optimistic people I have ever known have made some horrifically bad decisions, especially concerning money and relationships. Confidence can lead you badly astray.
Conversely, a good optimist understands that no matter how hard he/she works, much of life is random. A good optimist is aware of the downsides and plans for them, but doesn't assume that the downside case is likely to occur. And if a bad thing happens, a good optimist doesn't personalize it ("Why does this always happen to me?"). They direct their thoughts forward - "Well, I learned something and will apply it to my future."
Training the mind to moderate both worry and confidence is a lifelong pursuit. Hope I get better at it someday.