Supervise your dog when he is outside. Walk your dog on a leash, and keep an eye on him while he is in the yard. Discourage your dog verbally when you see him start to eat dirt and physically tug him away if he's on a leash. Try to distract him or redirect him, and give him praise when he leaves the dirt alone.