I believe (environment) and one's (past experiences) effects how positive or "hopeful" they are about their future prospects. Hanging around pessimistic people will cause you to become pessimistic. Focusing on what is "wrong" instead of what is "right" in the world will also bring you down. It requires work to stay positive in a world where negativity grabs the headlines and spotlight to sell or get high ratings.
We get to (choose) our own thoughts and determine what to focus our energy on. We also get to (choose) our own friends, lovers, and spouse. This is why we can say, "You are responsible for your own happiness." Whether one is pessimistic or optimistic is based upon how they limit (their) options in a world with infinite possibilites.