Barking usually has a pattern
A Yorkie that barks at the gate, the neighbour, the other dogs, or every visitor is often trying to control the environment. Start by reducing chaos: enough sleep, fewer rehearsals of the trigger, calm interruption, reward for quiet, and a predictable place to settle.
Scolding can make a sensitive dog louder because it adds more emotion to the moment. Quiet, repeated structure works better than shouting.