The mind is divided into parts that sometimes conflict. Like a rider on the back of an elephant, the conscious, reasoning part of the mind has only limited control over the automatic, emotional part.
People who learn to control inner experience will be able to determine the quality of their lives, which is as close as any of us can come to being happy.
Optimists tend to interpret their troubles as transient, controllable, and specific to one situation. Pessimists, on the other hand, believe that their troubles last forever, undermine everything they do, and are uncontrollable.