I think most of us do it probably because our parents/carers did it: that is to distract our child away from their uncomfortable emotions and away from the resulting likely outbursts. It sounds counter-intuitive, but I think distracting a child away from what they are feeling is not helpful and adds to the idea that emotions should be ignored, suppressed and not expressed. Distractions also prevents emotions from being processed properly.
Distraction for an adult would be the equivalent of you just discovering some deeply upsetting news and someone saying, ‘Ooo, look over there, there’s an ice cream stall – let’s go and see if they have chocolate flavour.” It is an inappropriate response, it completely invalidates what you are feeling and denies you your need to express it. In the long term, distraction means your child is unlikely to be very ’emotion aware’ or develop healthy coping strategies.
Children do tend to have more regular emotional outbursts than adults and they can be over issues that seem very trivial to us, so it can be tempting to distract away from the inevitable scene. However, in the long run, because the emotion is very real for your child, it is better to indulge it. By that, it means acknowledging what they are feeling and why and then soothing them. This will usually be with a hug. If the fact you said no to something was the cause of the outburst, there’s no need to give in to the tantrum and go back on your word. Your child still needs to know you maintain boundaries but you can still be sympathetic to the fact they are experiencing an uncomfortable emotion. In the long run this will produce an older child who manages their emotions more effectively.