>>585244First off the pup needs to know: come, sit, stay, go, leave it, and be leash trained.
1) get a leash as long as you want the dog to go. so if you're fine with the dog wandering around 20 ft away from you, you can get a really long one. If you want them to stay close use a short one. Then when ever the dog pulls on the leash, you tug hard and or give the dog a light smack (punishment). If the dog stays close to you for awhile reward them with pets, water, treats, toys, etc.
2) with no people around let the dog off the leash entirely. If they wander off too far tell them to stop, if they don't stop right away and you have to chase them and/or yell, reattach the leash and punish them. After a few minutes on the leash of them behaving well let them back off. If they did stop right when you told them to reward them and continue walking around with them off the leash. if you see anyone in the distance make sure you leash them.
3) after like a month of off leash practice you can keep them off the leash when people are near, but I would still leash them up if you see another dog.
Basically you reward them for staying close and listening and punish them if they run off or don't listen.
Also if the dog is having a particularly bad day just leave them on the leash.