Imagine for a moment that you picked up a hammer from your toolbox, and then forgot that you were holding it. You'd walk around all day with the hammer in your hand: You'd open doors with it, use it to shift gears in your car, poke people with it to get their attention, tap it on the table when you're bored, use it (somehow) to eat your food... If you have a forgotten hammer in our hands, you'll use it for all sorts of things whether it's useful or not, merely because you have it in your hand.
The thinking mind is a tool we use to solve problems. That's what it does. Unfortunately, most of us don't remember that we're holding it, most of the time, and we don't know how to put it down when we don't need it. And so we find ourselves using our mind for things it's not really useful for, or to entertain ourselves when we're bored, or whatever. It's always there, something we're clutching without realizing it, and using for no other reason than that we're clutching it.
That's the value of meditation. It teaches us to put the tool of the mind down, by creating a context where we just don't need to use the mind at all. But whether or not you're in meditation, if you feel an irrepressible urge to do something or think something, ask yourself whether you actually need to use that tool at just that moment. If you don't, then stop. You have to keep reminding yourself that the thinking mind is a tool you use when you want or need to, not a thing constantly held at the ready.