My formula for understanding life is:
Every event and situation in your life is meant to be a test of your character.
For example, both poverty and wealth are tests. A wealthy person might become arrogant and forget Hashem. A poor person might be tempted to steal and commit fraud.
When life goes smoothly, it tests one’s character, and so does a life of suffering.
~ Ramchal in Mesilas Yesharim