Beware of your triggers! Only you know the factors that have a negative impact on you and trigger you to act in ways you normally don't and would not want to. Perhaps it is a recurring problem. Perhaps it is yet another snark comment by a co-worker. Perhaps it is a family member. Only you know what these triggers are.
Perform mental scenarios to prepare for and address these triggers appropriately when they come up unexpectedly. Actively practicing and preparing for these scenarios will allow you to continue along the path of becoming the thoughtful person you want to be, rather than the reactive person your environment forces you to be.
Beyond scenario planning, self-awareness, situational awareness, and interpersonal awareness will be key to appropriately responding to these triggers.