When you begin meditating, you will notice lots of thoughts rushing in. The trick is not hold onto them but notice and come back to your anchor. In this way meditation is an exercise of training the mind to allow you to see your thought patterns more clearly.
In short, meditation builds attention and clears and calms the mind to discover an infinite space of inner stillness. With practice, you may learn to see a situation more clearly, lovingly and then have the wisdom of knowing when and how to respond rather than react.