When your dog or puppy finds himself/herself scared of a situation, he/she freezes and his/her brain switches off temporarily. Therefore by remaining calm and by reassuring him/her, you are allowing your dog or puppy to gain confidence that the situation is safe. Praise him/her in a quietly manner.
Fireworks for example can be terrifying for dogs and puppies.
If your dog or puppy is struggling to relax and calm down, training to identify the issue might be helpful in order to alter his/her understanding of the situation, and in time modifying his/her behaviour to a happier state.