I think one of the most important factors to happiness is perspective and the ability to develop and nurture it before a long amount of time has passed.
Given time and distance we can see how the trail of bad things were leading us to something good. It changes our mind on whether the bad times were worth it and most of us submit to the age old truth that those things needed to happen to us. If we’re able to keep that mindset in the present it changes our reaction to negative events. We start to see them as brutal necessities that will lead us exactly were we need to go.
It’s a hard mindset to keep though, and it is always easier said than done. One thing that greatly helps us cultivate perspective in the present is gratitude.
Giving thanks daily keeps our mind centered on the good. It helps us maintain a positive outlook on the future by realizing if there is good hidden throughout our terrible day, there will be far more when the darkness starts to fade.