A child in a tantrum has their mind stuck in a loop, helping them break out of it and/or refocus makes it easier to deal with the situation reasonably.
Probably very dependent on the child and situation, but anything that might break their focus on the situation: changing subject; doing something silly; showing some other interesting thing; sometimes just stop engaging the tantrum can work.
Stop engaging the tantrum is what the literature says is the best practice. IIRC fMRIs show not that the mind (prefrontal cortex) is in a loop but that the prefrontal cortex is entirely shut down and the limbic system is highly active. Basically they are just having a tiny breakdown because whatever it is they are chanting about was the straw that broke the camel's back in terms of how much challenge they can accept in a day. Luckily, the other side of it is a reset and they are back to 100% capacity. So just let it be and when the screams change from anger to sadness, hug it out and then move along as if it never happened.
It is we adults who are bothered by tantrums. Kids don't even remember them. Because the memory parts of the brain are offline. We have a choice about whether we are bothered. We can choose not to be.
I have spent so much time trying to implement this approach, but my lizard brain seems to also take over in these moments. I am making great progress, but I think I have some more work to do on myself before I can be what my children need from me when they are experiencing tantrums.