Dogs bark for many different reasons and it is a natural way for them to communicate. Barking by itself is not a problem behavior in dogs. Dogs bark for many reasons, and some of them may be useful for you as an owner.
In order to warn you of a potential intruder lurking in the backyard, you might want your dog to bark. Excessive barking becomes real problematic behavior when your dog continues to bark constantly and consistently without any reasonable reason (Clear to you) to do so.
Training your dog new habits, redirecting him, and training obedience are all effective methods in this situation. Identifying the cause and the situations that make your dog bark is the first step to solving unwanted and excessive barking in your dog. Once you determine the causes, try to eliminate them first.
Teach your dog to respond appropriately to those situations, as well as desensitize the dog to those specific triggers. As an example, if your dog barks every time someone comes to the door, you can teach him to bark a few times, and then wait quietly by the door to see who comes.