Don’t ever become a pessimist... a pessimist is correct oftener than an optimist, but an optimist has more fun, and neither can stop the march of events.
Robert A. Heinlein
I'm not sure it is a choice. I think it comes with lifes observation and experiences. I feel a little like Mark Twain; I was born an optimist but it didn't stick.
There is nothing sadder than a young pessimist. Mark Twain
The man who is a pessimist before 40 knows too much; if he is an optimist after 40, he knows too little. ---Mark Twain
As a pessimist, I am usually always right and when I am wrong, I am pleasantly surprised.
"The optimist proclaims that we live in the best of all possible worlds, and the pessimist fears this is true." - James Branch Cabell
This is good advice.
"Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great." Mark Twain