I overthink all the time, and I notice no negative side effects from it other than not being able to fall asleep easily. Quite on the contrary, I'd say the net effect is overwhelmingly positive.
Your problem seems to be a lack of focus and its resulting compulsion. If you want to practice focus you can just try to pay attention to your breath and increase the duration of that exercise over time, or practice calculations or other short-term memory tasks in your head.
Write something you're thinking about
If only you think about it, the mind will become more numerous. So what's wrong with trying to write everything you have in your mind into a piece of paper. It will help you a lot and lighten the burden of your mind. By writing your problem or what step you will take, who knows you will find the solution or choice you will take. Writing your every thought before you sleep is probably a good idea. It can also make you sleep more soundly.