"Make the best use of what is in your power, and take the rest as it happens. Some things are up to us and some things are not up to us. Our opinions are up to us, and our impulses, desires, aversions—in short, whatever is our own doing. Our bodies are not up to us, nor are our possessions, our reputations, or our public offices, or, that is, whatever is not our own doing."
"We have no power over external things, and the good that ought to be the object of our earnest pursuit, is to be found only within ourselves."
"Practice then from the start to say to every harsh impression, "You are an impression, and not at all the thing you appear to be." Then examine it and test it by these rules you have, and firstly, and chiefly, by this: whether the impression has to do with the things that are up to us, or those that are not; and if it has to do with the things that are not up to us, be ready to reply, "It is nothing to me.""
Sources: https://en.wikipedia.org/wiki/Epictetus, https://en.wikipedia.org/wiki/Serenity_Prayer
It is said that focusing attention on the now is a trainable skill. Regularly practicing it is said to make it easier to "come back" and become less attached to troubling thoughts and emotions.
This can be done by focusing on physical sensations like one's breathing, the sensation of the body making contact with furniture or the floor, a soft blanket against skin, concentrating on music or sounds in the surroundings, smells, taste, and many more. This can be practiced in small moments when the thoughts wander.
Below: video that explains meditation/mindfulness and its applications in a practical manner.