Exercise will keep your mind occupied and stop the overthinking, but it is not the solution, it will help the symptoms on a temporary basis, by keeping your mind occupied and giving you something to focus on.