Overthinking causes anxiety. Not the other way around. Control your thinking and you can begin to control anxiety, fear, worry, and sadness. The best way to overcome the trap you set for yourself by overthinking is in the service of others. Second, learn something new (physical, reading, writing, etc.). Third, do the tasks that you know you must do. In all three of those solutions, you are becoming more useful.