Barking is communication, and a young puppy has only a few ways to say 'someone is at the door' or 'I am wound up.' The mistake I see is waiting until the barking is already loud, then trying to talk over it. Set up a practice knock at the door while the house is calm. Ask for a sit or a settle on a mat, reward that quiet behavior, and only then open the door. If the puppy breaks, close the door and start again. Two or three short rehearsals beat one long, frustrating session. For a version you can follow step by step at home, I keep our barking training guide here: https://lovemypuppy.store/barking-puppy-training/
Love My Puppy / Larry Meyers