It depends on the child.
Your best bet, as kathryn says, is to try and anticipate the tantrum, but it can be difficult and it does take time to work out what sets them off, when the behaviour is occurring and any other possible triggers (illness, siblings, etc). So take your time, don't be downhearted by it in the meantime.
I had a charge who needed to be completely removed from the situation he was in to calm down. The family had a naughty corner so when he was getting really het up about something he'd be put there for a couple of minutes until he'd calmed down. It really worked for him as he'd get more and more agitated if you sat with him. It didn't work for his siblings though, they'd get really upset being put there and needed you to sit them down and talk gently to them.
I didn't really like the naughty corner towards the end of the job though as he had to be put there more often and it was his only way of being to calm himself down, I don't think I'd be comfortable using it again regularly. I also didn't like it being called the naughty corner, but some aren't phased.
Some of my charges have been hold firmly and cuddle/speak softly types, some I just had to ignore, etc. Speak to the parents and find out how they would prefer you to handle it.