I am a firm believer in the "boring cuddle" no words just a tight hug when you see the signs.
Then if it's a genuine need for attention I have been there physically for ds, if not it's also an active way of ignoring his behaviour.
I don't like leaving the room. How would I feel if I was upset at something and my dh left the room whilst I was trying to explain it to him?
I don't like distraction - it's too much like trying to fix the problem. And sometimes the problem is impossible to even spot, let alone fix.
I just like a big hug with no frills, and then ds clambers down in his own time and either works on the frustration (climbs up the slide again, tries the puzzle piece again) or goes to do something else.
Now he will start to look frustrated and maybe pick up a toy and look as if he is going to throw it down, then he stops and then calmly places it on the floor and comes over and give me a cuddle.
My friend uses this technique and her son is the most chilled little boy I have ever seen.