How much trouble can your dog get himself into?
Quite a lot, as it happens. When your hungry hound chows down on garbage in the park, then 'garbage gut' is often the unpleasant consequence. And that's the good scenario! All sorts of dangers await the unwary, from rat poison to cocoa mulch, from daffodil bulbs to stones, a pet parent must protect their dog from himself.
The answer to this problem is training, but you need to be realistic about how long this takes. If your dog is a danger to himself while he's learning, then consider using a muzzle while out on walks so that he's physically unable to eat things he shouldn't. Then once your commands are rock solid, ditch the muzzle.
Training the dog to not eat off the ground involves a command that immediately focuses his attention away from the object. This could be 'Leave it', where he physically leaves the object, 'Drop it', which goes a step further and has the dog drop something out of his mouth, or a strong recall which has him move away from the danger.
Success depends on regular training so that the dog doesn't hesitate to obey, even when faced with the tastiest of finds on the ground. Dogs that aren't food-obsessed tend to learn this lesson more quickly than those with a bottomless pit for a stomach...but stick with it, you will get there in the end and it could save your dog's life.
Whichever method you decide to teach (Why not learn all three?) you'll need:
As with so many commands, the dog learns fastest when he is a puppy. However, dogs of all ages will and do learn, so it's never too late to teach an old dog new tricks.