The function
The candy, the screen, the toy at the store — the specific 'thing' is rarely the real thing. It's the experience of wanting something and being told no. That's a big feeling in a small body.
What works
Validate the want out loud, THEN restate the limit. 'You really wanted that. I get it. The answer is still no.' Offer a bridge ('not tonight — let's plan it for Saturday'). Sit near while the disappointment moves through. Emotion coaching (John Gottman's work) is the gold standard here.
Parenting styles that help
Warm-and-firm authoritative parenting. Emotion coaching. Any approach that separates 'feelings are always okay' from 'behaviors have limits.' The limit stays; the feelings are welcome.
What backfires
Caving mid-storm (the storm gets bigger next time), lecturing, shaming ('you're being ridiculous'), or trying to talk the feeling away. Disappointment IS the lesson.