It looks like You are a very anxious person. When any time stress increases you start with restlessness and overthinking.
You need to calm your mind. Meditation,yoga,music or other outdoor activities will divert your mind.
Next Steps
In case all these don’t work for you a psychiatric consultation may be helpful.