Barking is a dog's primary means of vocal communication. The Humane Society lists a number of common causes of incessant barking, including attention seeking, boredom, hunger, frustration, excitement, fear and protectiveness. Some dogs bark due to health conditions such as deafness, dementia or Canine Cognitive Dysfunction.
The first step to stopping excessive barking is to determine the type of bark the dog is expressing. The time and location of the barking, the surrounding environment, and the presence of sounds, objects, people or other animals are all factors that help determine why a dog is barking. Dogs that bark due to health-related issues require a bit of patience, as well as a simple, orderly and non-threatening environment.
For otherwise healthy dogs that just bark too much, there are a variety of ways to curb the behavior. One way is to ignore the barking and reward the dog when he is being quiet. Another way is to remove the stimuli from the situation. A reliable way to curb excessive barking is to keep the dog mentally and physically stimulated. A bored dog with too much energy needs to express that energy in some way. Going for long walks and engaging in regular active playtime helps discourage the dog from seeking stimulation in other ways.