Sitting in meditation is a good way to see the monkey mind in its natural habitat. Just sitting still and clearing the mind is so challenging. You observe one thought popping up, and another, and another. This is inevitable, especially when you are getting started. The trick is to learn to observe the thoughts without engaging in them. An analogy I like is to see the mind as the sky and the thoughts like clouds passing through.
Whether you are meditating or practicing asanas, returning your attention again and again to the breath will always help you detach from the thoughts and return to the present moment. Each inhale and exhale exists only in the present. When you are doing asanas, remind yourself to use Ocean Breathing (Ujjayi) each time you catch yourself thinking.