Unless we are aware that thoughts are happening, then usually we’re just driven by them - the “little dictators” in the mind that Dan refers to. As we start to pay more attention to mental phenomena though, we become familiar with our own mental habits; for example the tendency to get distracted, lost in fantasy or worry, or caught in recurrent emotions.
With practice, it becomes easier to notice when we’re lost, and gently bring the awareness back to whatever it is we want to be paying attention to. This needs to be done with patient, kind persistence though, because attempting to force the mind to focus or be more disciplined is often counter-productive: a bit like trying to train a puppy to sit still by hitting it. Repeatedly and gently bringing the mind back to simply being present with experience, is what develops the kind of focus and discipline you’re aiming for.