Loud dog barking causes discomfort not only to household members, but can also disturb neighbors.
Therefore, before such behavior becomes a habit for your pet, you need to start fighting it.
However, some methods that pet owners resort to not only do not help, but can also cause harm.

How not to train a dog
Firstly, you can't shout at a dog. The pet might think that you are playing with it, or it might get scared and start barking even louder.
Therefore, it is enough to speak in a loud voice without shouting.
Secondly, you can't beat a dog. The price of such an achievement may be too high, and instead of a devoted pet you will get an embittered animal.
Thirdly, even as a joke, you can't be touched by barking. The more you pay attention to what's happening, the more the dog will become convinced that its behavior is correct and that you like it.
Fourthly, don't take it to extremes. Locking up your pet and leaving it alone for long periods of time as a punishment is not an option.