Overthinking feels like problem-solving, but it usually works as a way to avoid uncertainty or an uncomfortable feeling. Each loop brings a little relief, which teaches your mind to loop again.
Trying to stop the thoughts tends to make them louder. Therapy helps you notice the loop, understand what it is protecting you from, and step out of it more often.
