So far I've spoken mostly to what GMs should do to deal with a triggered player. However, what if you're the triggered player, or if you as the GM get triggered.
Some people feel as the GM that you may have more leeway in avoiding upsetting subject matter.
Those people would be wrong.
It seems like for a long time, we always had that one player who, when asked to leave certain things alone in game, i.e. no fighting animals, no child abuse, no rape, whatever, would decide that you had just presented them with a bright, red candy-like button to push and push and push.
So, before I go into things you can do to help yourself if triggered, I want to state for the record: GMs can also be triggered and they have just as much right to stop the action and deal with the issue as players do.
This is by no means an exhaustive list. It is primarily made up of what works for me and for friends of mine. Please feel free to add your own suggestions in the comments.
Something happened in game that flipped your trigger and you have called for a time out, thrown in the X-card, asked for a break.
This depends entirely on you. If you know what works for you, do it. This can be anything from a quick cry, either before or after talking to the GM, to borrowing your significant other's hoodie and wrapping yourself up in it so you are surrounded by the smell of them and warm. It can mean stepping way entirely. It can mean asking for a retcon and just let me mostly spectate, I'll jump in when I'm ready. It can mean, we need to work through the aftermath of this, including the perpetrator's bloody end and the rallying around my character by the others. It can be a chocolate bar and a shot of whiskey.
There are as many soothing and self-soothing behaviors out there as there are people who have been triggered, and odds are good if you've been triggered on a regular basis you're familiar with at least a few things that work.
I have a tendency to steal the Geek Husband What Rules's hoodie and wrap myself up in it. He generally doesn't even ask why, just if I ask for it, hands it over. I also tend to want to be close to him and lean a lot. Ogre is my safe-space.*
If you've never been triggered before, well, that paragraph where I listed a bunch of stuff? Try some of those, or anything else that you know tends to make you feel relaxed. Have a cigarette if you smoke. Eat something, since low blood sugar tends to make me more easily triggered. Call or text a friend. Cry in the bathroom. Whatever you need to do, up to and including walking away from the table and hiding in your car or hotel room for a little while.
Again, there is no wrong way to deal with trauma or triggers.
Granted, you should probably try to avoid yelling directly at anyone, even if they triggered you purposely (you think). But if it happens, it happens, and hopefully they can be an adult about it after the fact. (If they triggered you purposely without your permission, that adult part is unlikely.) You may apologize or not, depending on the situation.
I can't tell you for certain what will soothe you when you're triggered, only you can answer that. But whatever it is you think you need, try it. Odds are good it will help at least a little.
*Despite the fact of him coming up with the concept of the Hershey Kiss in a shot of whiskey shooter.