Dogs bark for many reasons so dog barking can easily become an excessive habit.
A dog that doesn't get enough exercise may bark excessively because barking provides physical activity which is lacking in his daily routine. A healthy young dog needs at least one hour of intense running and playing every day.
Without sufficient exercise, a dog may become restless and start barking at everything that moves, just for something to do.
If your dog barks too much, increase his activity level. Take him for long walks, take him swimming, or train him in agility or another energetic sport.
Even a dog who exercises adequately may bark excessivley when home alone because barking provides entertainment.
To decrease boredom dog barking, you have to provide something more interesting for the dog to do with his mouth. Food-dispensing toys work very well for this purpose. These toys come in different shapes and sizes and they have a hollow space inside for hiding food. The food comes out bit by bit as the dog chews the toy, keeping him focused and quiet for a long time.
If your dog is baking at what he sees outdoors, obscure his view by rearranging the furniture if neccesary. In the backyard, a section of opaque fencing or strategically planted bush can be useful in limiting the dog's view without creating an ugly barrier.
There are electronic sensor collars on the market which deliver an aversive consequence when the dog barks. There are also bark-activated noisemakers you can place where your dog usually barks most. The sudden sound startles the dog and he loses focus on what he's been barking at. When the dog stops barking, give him a praise or treat for being quiet.