In fact, a dog cannot bark without a reason. It is only humans who think that a dog only barks when it feels threatened.
Barking and howling in dogs are the same ways of communication as speech in humans, so there is nothing surprising about this. You need to look for the cause.
Experts explained why dogs bark and what needs to be done to calm your pet down.

What is the reason?
Firstly, it may be an attempt by the dog to attract the owner’s attention, including a request for help.
Secondly, a dog may bark in response to some incomprehensible situation outside the window or in the neighboring apartment.
Thirdly, by barking the animal tries to prevent encroachment on its space.
Fourthly, a dog may bark out of fear or other anxiety.
To determine the cause accurately, you need to take into account the character, age, and socialization of the pet.
How to calm a dog
It is completely useless to shout at an animal or otherwise suppress its will.
All this only irritates the dog and makes it react even more emotionally, and perhaps even aggressively.
Physical methods of influence can fundamentally harm the relationship between the owner and the dog.
The dog simply won’t understand what the person’s behavior is related to, so the reaction may be unpredictable.
You need to try to calm the animal down by speaking in a calm and friendly voice.
If necessary, it is worth showing your pet to a specialist, and also devoting more time to training and exercising the dog.