No action should be undertaken without aim, or other than in conformity with a principle affirming the art of life.
Ryan Holiday's book The Obstacle is the Way is based off the premise of this passage.
The true key to resiliency is attitude and how you view the world. Each of us has a "ruling power" - the essence of what makes us human - the ability to choose how we think, feel and act. And this ruling power is flexible. That is the secret sauce - we are not some robot made of some rigid set of rules that we never deviate from. We can change our perspective regardless of circumstances, events and other peoples' actions and attitudes.
As Hadot quotes Seneca in The Inner Citadel, he says, "A good person dyes events with his own color ... and turns whatever happens to his own benefit." (p. 199).
I used to be ticked off whenever my manager or leadership would talk about challenges as opportunities. I used to think it was just spin. Well, it is spin, but also more - it is an attitude adjustment; it's a way to look at all events as opportunities to grow.
The other concept to remember about turning obstacles into opportunities is to view everything as practice. Earthquakes, bad presentations, little sleep, a car wreck, health problems ... all can be seen as opportunities to improve your resiliency - opportunities to show your mettle.
To conclude, let me share a favorite movie scene from Batman Begins. Bruce Wayne is in a foreign prison and is about to be beat up. The big dude about to bust his chops threatens him, to which Bruce responds, "you're not the devil, you're practice."
(see also Citadel p. 198)