How do you get your dog to stop eating poop?

Disgusting as it is go to the vet and get 'forbid" as it makes their poop taste yucky to them.