Teaching your dog manners requires time, patience, and dedication from you both. Starting with proper equipment, such as a harness for a larger dog, the correct size leash for you to maintain control, and treats to keep your dog's attention will set you up for good behavior while walking. Training puppies to behave on walks is easier than training a dog who has years of bad habits built up. This could take several weeks and tons of dedication from you and your dog. Be patient and change your routes if you need to in order to avoid distractions while your dog is working on training. Keep your dog focused and be prepared for rewarding your dog's positive behaviors.
Depending on your dog's size and breed, you may want to consider a harness instead of simply a collar. A harness which clips to the back will give you more control over the dog than having a dog pull with a collar. Using a collar on a dog who pulls could cause injuries for you as well as trachea injuries for your dog. For large breed dogs or dogs who are out of control, consider using a harness which clips on the chest. When your dog pulls up, you can pull the leash down, maintaining better control. Special treats for these walks are imperative. Keep a baggie full of processed meat, jerky, or even cheese to entice your dog to behave well while he is in training.