We would start by letting the dog see us put a piece of kibble or lower value cookie in our hands and make a fist, or put it on the ground and step on it. Then we'd let the dog sniff and sniff and when he stopped trying to get the kibble under our foot or in our closed fist we would click and treat with a higher value food.
Then we would build, adding the verbal cue "leave it" and then slowly opening our hands/leaving the kibble out on the floor. And then we would line up a bunch of treats around and weave through telling them to "leave it" for some of the treats, and "take it" for others.
Now I can line cookies up and down my dog's paws and he will just sigh and put his head on the ground, and a "leave it" works for all the delicious trash he wants to eat during our walks...
Whitman ARCH, RL1X, RL1 (AOE), RL2 (AOE), CL1, CL2, CL3 3/01/2010 GSDx
George 3/01/2008 Orange Tabby DSH cat
Sofia 3/01/2008 Black DSH cat