The key element in my personal experience is to make peace with how things are in that moment. That something triggered this unpleasant emotional state/disturbance, that it is totally okay, and not to push it away but instead give it gentle, loving awareness. The trick that works for me is to think of someone who I love, or someone who loves me, imagine that we look each other in the eyes or gently touch the part of the body that feels unpleasant, feel the "warmth of love" developing in me, and then switch from using a third party to myself, so both the sender and recipient of love is me. Looking into the mirror helps. And then staying present with the sensations, realizing that I can have a clear and calm mind and the unpleasant sensations at the same time, give them the attention they deserve, passively listening to what kind of memories come up (if any), and just wait and give it time.
Doing something that gives you a good feeling, that you are capable of taking care of yourself in that moment, like sports/healthy food etc, can help to put you into that necessary emotional state, but the key is the emotional state, not the outside activity. Unless you achieve that calm state of mind, activity "on the outside" could be purely a distraction, and while "successfully" disconnecting you from the feeling, that way it only makes it come back a little stronger the next time.
It does not seem to be relevant to figure out what the trigger was, or what the past experience was, or whether the strong emotion relates to something that happened "just now" or in the past. Thinking about that is a distraction of the mind and "serves no purpose". It does help to identify the more specific feeling beyond "anxiety". For example, I might suddenly get hit with a feeling of terrible loneliness or insecurity/threat to my life, even though I am with my partner or among friends in a "rationally safe environment". Instead of telling myself "hey you idiot, listen, you are not alone, stop feeling lonely right now!", or worse finding some element in the present I can project my current feelings onto ("that guy is a complete arsehole, that's why I am feeling rage right now"), I instead tell myself "this is a memory of a moment where I really was left alone, where there was really a threat to my life. poor me. thank you for reminding me of that past horrible moment, now that i am fully capable of giving it the loving attention that it deserved back then, but didn't get until now. I am very happy that I can give myself that love now, to fully make up for it.". An image that helps me is "a mother holding her crying baby": Gentle, loving, not pushing, not asking questions: the baby cannot answer. Both the mother and the baby are me.
Another way to look at it is that I first create an imaginary wall between the mind and the body: The mind can think whatever it wants, race around, keep itself busy, or relaxed or whatever. I don't care. I don't push it outside of my consciousness, still listening to it sometimes, but I leave it alone, and do not allow it to influence the body in any way. The body is given fully to the crying/hurt child/emotion, not fighting it at all: if it wants to kick, I let it kick. Except for my hands, which I give to the soothing mother with healing power, and lightly rest them on some part of the body where the unpleasant sensation is. The soothing mother also gives the same love to the mind, another one of its children. Then, as a final step, "I" separate myself from all these parts, chill and relax, knowing that all relevant work is delegated, everyone is taken care of. Like the manager of an inner kindergarden, or inner playground, where there is a lot going on but at the same time I can take a break from it, knowing everything is running smoothly.
This process takes some effort to learn, and accepting that you are still learning and not already perfect at it is a key part of the practice. But even small moments where it "works" in my experience finally actually resolve stored up emotions, so each time an unpleasant emotion comes up it hits me less and less, and the frequency goes down massively. It is not important to understand exactly what triggered it, or what the past traumatic memory is. Do not ask yourself, just be, and connect both to your heart and the pain at the same time.
There are many different techniques but they all share these core elements. The one I like the most is "Feeding your demons" by Tsultrim Allione.