How do you stop overthinking?

I'm a chronic overthinker. I can literally turn my mood from happy and carefree to low and worried in 0.0012473 seconds because of a tiny irrelevant thing. I create problems that don't exist. And I ruin my day/night because of it. There are times I've lay awake all night overthinking everything