My DD1 is 5 and still sometimes has tantrums. She's always been high-strung, though. She goes through long easygoing phases, and then every once in a while a rough phase, where for a few days or weeks she's sensitive, and flies off the handle easily.
At her age, I feel very comfortable setting firm limits about how she can express her anger. I say to her that she may scream and yell all she likes, but that she needs to confine that screaming and yelling to her own bedroom. If she's angry with me, she needs to calm down enough to tell me so clearly, without namecalling or incoherent hollering. So we practice, in between incidents, phrases like "I'm really MAD at you mama." When she is starting to blow up, I'll say to her that she seems really mad, and I ask her what she needs to feel better. Sometimes she's able to tell me, and sometimes she's not. If she starts getting more upset, I'll repeat myself-- you're angry. Can you control yourself and tell me what you need?
If she storms for more than a minute or two, I'll lead her up to her room, and tell her to sit and calm down, and that we'll talk when she's ready. If she's not being abusive to me, I'll stay in the room with her, quietly. If she hits, or yells harshly at me, or I feel otherwise abused, I'll tell her quietly that I don't want to be treated that way, and then I'll leave the room. I'll wait until long after she's settled, before I attempt to talk about it with her. But we do talk about it, at length, once she's calm. If she leaves the room before she's calm, I just lead her back again.
Then I'll leave her to get control of herself.
When it happens while we're out, I'll get close and talk softly in her ear-- I hear whining and complaining. If you can't stop, or if you start to yell, we're going to go (XYZ-- car, outside, wherever seems like a handy cooling-down spot, or even home).
I handle big-girl tantrums differently from toddler ones. I have seen by this age that DD can and will calm herself down if she's left alone to do it, and that sticking around trying to help her only escalates the situation, and that when she chooses to use them, she does have the skills to pull herself together and explain her needs assertively. So I am pretty firm about not sticking around and allowing myself to be yelled at or hit.
One thing that really helps us too is watching her sleep patterns. I know that when she's tired, she's short-tempered. Even one late night or particularly long day can be enough to exhaust her, and it might take two or three days for her to get back on track. So we guard her sleep pretty carefully. For other kids, it might be needing to eat and drink often enough, or needing time outside to play rough and blow off steam, or needing some time with other kids, or maybe needing lots of quiet time alone. For my kids, it's mostly sleep that sets them off.