Positive emotions are important. Optimism and generosity towards others strengthen us, make us satisfied and resistant to stress. It stimulates our creativity and ability to solve problems. We get better physical health and live longer. It is less likely to suffer from heart disease and to deal with more difficult diseases and treatments.
What makes us happy?
Some consider money, which in some circumstances may give a feeling of happiness for a limited time, but that feeling is not permanent.
The most important thing seems to be our relationships with others. What we do for others makes us happy and gives meaning to life and increases well-being. Even small events count, like helping an elderly person across the street or giving someone a fifth.
The other important measure is gratitude. If you exercise gratitude regularly, you become more happy and optimistic. When we are grateful, we are motivated to strengthen our relationships, both with our familymembers and others in the social context. Gratitude also improves physical health and development for spirituality.

Optimism means looking forward to the future, having positive expectations, expecting good things to happen. That helps people to manage stress effectively. Optimism can be seen as a personality trait, something that is stable and consistent over time. Which does not exclude that occasionally emotions can turn even for the most optimistic person.
Research shows that optimism varies from country to country, but most people choose to think optimistically. In western countries people see themselves as independent individuals, separated from others while East Asian countries see more that they are connected to each other. With community follows optimism.
What about pessimism? Is there something we absolutely want to avoid? A certain pessimism can be helpful if, for example, predicts negative events because then one can come up with a strategy to prevent it from happening. But it is important that you allow this to be under control so that you do not go away with your imagination and start painting up disaster scenes that you cannot prepare for, because then anxiety is a fact. There is no perfect path, everyone must find theirs that works best for them.
In CBT, you learn techniques and strategies to learn to have positive expectations and think optimistically. E.g. work away a negative expectation of the future, release the perfectionist and set realistic goals that can be achieved and gives satisfaction.