Try to determine why your dog barks'eliminating the cause will increase your chances of success.
Have your dog's favorite treat within reach.
Praise the dog for barking once he starts by saying 'Good job' and then 'What's the matter?'
Tell the dog, 'Be quiet.'
Wave the treat in front of your dog's nose.
Keep praising the dog.
Let the dog have the treat after 3 seconds of quiet time
Wave another treat in front of your dog if he starts to bark again.
Scold your dog every time he makes a mistake.
Increase the quiet-time intervals by 3 seconds each time