This reminds me of the Serenity Prayer:
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
The only thing we can control is our reaction to the things that happen around us. Things won’t affect us if we don’t let them. Also ties into stoicism, I’d recommend reading Marcus Aurelius Meditations!