It is very hard to keep your cool when those around you are losing theirs. It is especially difficult when you as the referee are the recipient of the remonstrations.
But, it can be done successfully, as the referees in this montage so professionally demonstrate.
Remember: model the behavior you want the players to follow. If you want them to calm down, you have to be calm.
My favorite is the clip featuring referee Michael Oliver. The player is clearly upset, and Oliver allows him to have his say, all the while making his intentions clear by holding the yellow card low in his hand. He’s allowing the player to blow off steam and enforcing the Laws of the Game with regard to dissent. Just good, common sense refereeing.