stoicism.
Being a stoic isn't about being cold and unfeeling, it's about separating the things that are within your control from the things that are out of your control.
"There is only one way to happiness and that is to cease worrying about things which are beyond the power of our will."
"Man is not worried by real problems so much as by his imagined anxieties about real problems."
"People are not disturbed by things, but by the views they take of them."
"Do not wish that all things will go well with you, but that you will go well with all things."
— Epictetus
The circumstances that are within your control to change you must be confident in yourself to rise to the challenge they present to you to the best of your ability.
External circumstances are beyond our power to change, and the only thing you have control over is how you respond to them.
"Some things are in our control and others not. Things in our control are opinion, pursuit, desire, aversion, and, in a word, whatever are our own actions. Things not in our control are body, property, reputation, command, and, in one word, whatever are not our own actions.
The things in our control are by nature free, unrestrained, unhindered; but those not in our control are weak, slavish, restrained, belonging to others. Remember, then, that if you suppose that things which are slavish by nature are also free, and that what belongs to others is your own, then you will be hindered. You will lament, you will be disturbed, and you will find fault both with gods and men. But if you suppose that only to be your own which is your own, and what belongs to others such as it really is, then no one will ever compel you or restrain you. Further, you will find fault with no one or accuse no one. You will do nothing against your will. No one will hurt you, you will have no enemies, and you not be harmed.
Aiming therefore at such great things, remember that you must not allow yourself to be carried, even with a slight tendency, towards the attainment of lesser things. Instead, you must entirely quit some things and for the present postpone the rest. But if you would both have these great things, along with power and riches, then you will not gain even the latter, because you aim at the former too: but you will absolutely fail of the former, by which alone happiness and freedom are achieved.
Work, therefore to be able to say to every harsh appearance, "You are but an appearance, and not absolutely the thing you appear to be." And then examine it by those rules which you have, and first, and chiefly, by this: whether it concerns the things which are in our own control, or those which are not; and, if it concerns anything not in our control, be prepared to say that it is nothing to you."
— Epictetus, Enchiridion