Meditation.
A regular meditation practice allows that small space to open up naturally between thought and action - just enough to give you the ability to see before reacting. It's not an overnight thing though. You have to keep plugging away, the most important thing is that it is a REGULAR part of your daily activites. Then slowly, bit by bit, that space opens up so that you are able to see the arising thoughts for what they are. You can just observe them and allow them to pass of their own accord. Eventually