When things don’t work out, relax. Even if it’s all your fault and you deserve everything you’re getting, trust in G‑d that it is all for the good, and stay calm.

When He sees how much you trust in Him,
He will make it be all for the good.

Is that fair?

Yes. Because trust in G‑d transforms you into an entirely different person, no longer the person who deserved the past.

Trust in G‑d enables you to receive all good things.

Likutei Sichot v. 36, Shemot 1.