From Epictetus:
Every situation and circumstance offers an opportunity for self-improvement.
It is up to you to make use of all your experiences – good and bad, pleasant and harsh – to better yourself and thus increase your wisdom and wellbeing.
The most difficult situations can be the best teachers, if you let them. Conversely, even the best circumstances will be detrimental to you unless you understand how to act upon them in a wise and well-tempered manner.