If your boss is moody or likes to shout, politely but firmly tell him or her how it makes you feel.
Telling people how their behaviour makes you feel is a non-threatening way of bringing up the issues that bother you.
You might sometimes get some form of abuse in response, in which case more decisive measures will need to be taken, but more often than not it’ll result in changed behaviour and a better relationship.
See previous ProfessionalGrowthTips and SelfCoachingQuestions at https://www.focusplanachieve.com