Here, two of several (or many) ways.
The easiest is just to turn the mind to something more useful, a task that needs doing, a creative project, pleasant memories of time with someone one loves, a good book or film, taking the dog for a walk, hard physical exercise, etc.
A way that takes more effort but pays huge dividends.
!. a. Another is write about it. Keep writing til the thoughts are exhausted. read it back and see what the underlying emotion is. Name and write it down.
__b. Sometimes it helps to lie down and allow the breath to flow however it does. Is it shallow, fast, light, intermittent, staggered, deep, slow... etc? Observe the body: where does the weight touch? how do the clothes feel? How does the air feel against the skin? What feelings are within the body. Are the muscles tense? Are some parts aching or tight? Where exactly? -- All emotions are accompanied by feelings in the body. What you feel identifies the emotion.
Quite often the emotions drive the thoughts and vice versa, in a kind of increasing spiral. But every emotion will start with a trigger, a feeling that is either pleasant or unpleasant. The rest comes from the way we interpret the feel, what we think it means. The meaning or significance we give to something can be wrong, so if it's about something that someone else said or did (or didn't), so it's worth checking with them.
2. Look at what triggered the emotion. Was it just what did or didn't happen or what was said or not? Or do you remember similar emotions coming up wit intensity in response to a situation in your childhood, maybe one that happened many times; if so, then part of the energy comes from that time back then, not with whatever triggered the feeling in the present. Getting those too separate is important. It helps to get the present situation into a more accurate perspective.
3. Examine the need underneath the emotion. For instance, beneath anger there may be fear, pain, shame or any mix of these. Shame arises when we, perhaps unconsciously, feel we've made a mistake, behaved inappropriately, done something against our own values, or perhaps have caused harm. It can feel extremely uncomfortable, and the tendency is to try to avoid it by getting defensive, hence the anger. Pain, either physical or emotional, can make us short-tempered, more reactive, less able to self-soothe and cope with stress. Fear can cause us to react with anger to try to prevent something unwanted from occurring. So then look for the need in those feelings. The need in feeling shame might be to make reparations, fix something; in pain, to get rest and heal; in fear, to assert boundaries, change habits, improve a relationship, etc.
4. Knowing the need, look for practical solutions. If there seem to be none, think creatively. Sometimes the need might be as simple as self-forgiveness, compassion for oneself - maybe a hot shower, a bath or a cup of coffee and time alone -- or maybe the opposite. The need might be to set a time to talk with someone and resolve an issue.