Here are my ideas, for what they're worth:
Your brain keeps going all the time, even when you aren't aware. If it really shut off, you'd be, um, dead.
But that's not what you're talking about, is it?
If your mind is going in directions it shouldn't go in, it's up to you to give it some new directions. It lives in your head and that means you're the boss.
So tell it, "No way!" Be proactive. Make new choices. Read different things than you're reading now. Turn off the television. Monitor your computer activities. Shake up your daily schedule if you can. Get fresh air. Get exercise. Get a new hobby. Do different good things with your children. Think what your closest buddies are like... and if they're not helping your mind with positive input, change your buddies.
Don't wait for circumstances outside you to change or for somebody else to change. Do it yourself, even a little bit.
If your imagination starts picturing things you don't want to see, *deliberately* substitute different pictures. (Funny different mental pictures might help - a little humor can be a total embarrassment to a figment of the imagination.) And start getting physically busy (that helps so much - with your sleeping as well as your thinking!).
It's sounds crazy but it isn't: when your mind starts going in the wrong direction, you can divert it to a better direction with action. We're all creatures of habit, and if, for instance, my mind gets fixed on comfort food, I can change what my mind is doing by changing my action. The hardest part, for me, is deciding that I really DO want to let go of what I'm thinking about. But: a) I can't have it both ways, and b) my imagination and my habits don't have to be in control of me. (I somehow doubt that you're thinking about comfort food, but I hope you get the idea.)
A well-respected motivational speaker often said: "You are what you are and where you are because of what has gone into your mind. You can change what you are and where you are by changing what goes into your mind." It isn't any kind of magical formula. It's isn't an impossibility, either. It's just work. Put better stuff in your head, and better stuff will come out. It sounds corny, but it works.
When you do this, you may possibly discover that you need outside help with whatever is keeping you from getting out of your own head. If you find this to be the case, get that help.