Planning for your dog to stop barking completely is not realistic barking is a natural dog behaviour and dogs will bark more or less and largely depending on the breed whether we want it or not.
Stop dog barking outside.
As your friend and their dog come into view start feeding your dog treats.
If your dog barks inappropriately it is important to start by setting yourself a realistic goal.
Barking at other dogs.
Have a friend with a dog stand out of sight or far enough away so your dog won t bark at the other dog.
You can hardly train the dog to stop barking by yelling at it across the yard.
Once your dog learns the calm verbal cue you can use it during times of unwanted barking such as the ring of a doorbell or the sound of other dogs barking to prompt the quiet response aka to stop the barking.
Repeat the process multiple times.
Don t reward attention seeking barking.
Stop feeding treats as soon as your friend and their dog disappear from view.
If your dog stops barking when they hear the cue reward them.
It s also safer because dogs left alone outside can face theft escapes poisoning harassment and other dangers.
Plus it is one of the fastest ways to turn neighbors into enemies and send an invitation to your local police.
Oftentimes owners try to stop a dog from barking in ways that fail to address long term behavior.
Don t let your dog bark constantly when it s outside regardless of the reason.
But dogs can still bark inside if bored.