How do you deal with sudden emotional dysregulation?

Has this ever happened to you: You’re going about your day and are suddenly faced with a minor inconvenience or something mildly negative. Anyone else would just react and move on. But your heart rate rises, your anxiety kicks in and the event dominates your thoughts, at least for the next few hours. You can’t think of anything else and cannot focus entirely on anything else- a part of your mind is stuck now on this negative thing that’s not worth any more time that maybe a minute or two.