The prevailing wisdom is that you should be happy when things are "going your way". Which means your happiness is dependent on the world deciding to cooperate and we all know how that turns out.
Let's say it is early morning and you just got into your car so you can drive to work. How many green lights do you need to have on (simultaneously) until you decide it is the right time to pull out of your driveway? Stupid question right? You'll drive out of your driveway and if you get to a red light, wait, then drive off until you encounter the next red light. Mix and repeat until work.
Happiness doesn't happen by chance, its a choice
Happiness is a mindset. It is a way of seeing the world. 2 people can live through the exact same situation and have extremely different experiences because of how they view the world.
Let's say your long term life partner leaves you for someone else. You can sulk for months asking everyone to pity you or you can tell yourself the wrong person left your life and now there is room for the right person to enter it.
Truly happy people are happy regardless of how the world treats them. They understand that even the darkest cloud has a silver lining. That after the fiercest storm will come calm and sun.
So the key to happiness is choosing to be happy. Allow yourself to be happy knowing that the bright sunshine is just around the corner.
When you choose to be happy, good things will be attracted to you. You will start seeing opportunities you would otherwise have missed.
Misery begets misery. Happiness begets happiness.