Pick up dog and calmly give a verbal command. If dog runs out to roadway barking at passers by, tie a lightweight long line to a choke collar and give a strong jerk as he reaches the property line. For large dogs tie end to tree. A good quality electronic bark collar may be used but it is best to consult a dog trainer or vet first. The surgical removal of the larynx is costly and not guaranteed, and should only be considered as a last option.
All dogs have different personalities.
While some may require a heavy correction, others will respond well to simple verbal reprimands. Match the correction to the temperament of the dog. If your dog only barks when you're not at home, you will have to set up a mock departure, making sure the dog sees you drive away. Return silently to make the necessary corrections. This procedure might have to be repeated several times.