Your pet gets some incentive when he barks. Otherwise, he would not get it done. Find out what he gets out of barking and take it off. Don't give your pet the possibility to continue the barking habit. If he barks at people or animals moving by the living room windows, control his habit by closing the curtains or placing your pet in another room. If he barks at passersby when he is in the yard, bring him into the house. Never leave your pet outside unsupervised all day long and night.
Make your pet bark less might take commitment. It will not happen in overnight, you will need to be steady in teaching your pet. Whenever your dog is barking, you command "Quiet" to your pet. Wait before dog halts barking, even if it is mere to take a deep breath, then praise and present an incentive to your dog. You need to be careful never to prize your dog while still barking.