First, decide an object of focus. This can be your breath or a word, or a combination of both.
With your attention on the breath, feel each rise and fall as you inhale and exhale. After enough time (or no time at all) your mind will wander.
When the mind wanders, and you become aware that it has wandered, gently note it as “thinking”. If the attention is focused on a different physical sensation, such as an itch or a place of discomfort, note it as “feeling”.
Once you’ve noted that you are thinking or feeling, gently bring the attention back to the object of focus.
In my experience, this practice will make it easier to recognize when the mind has drifted, letting you return to focus faster each time, and it will begin to drift less frequently as well.
I hope this helps! Best wishes with your meditation practice!