This is a very useful command and can be an important safety factor for your dog. Imagine being able to prevent your dog from wolfing down something that is potentially toxic, caustic or might burn them!
Start with a few treats in a closed hand. Tell the dog to ‘Leave it’. The dog will likely work away at trying to get the treat out of your hand but as long as they are trying there is no reward (some dogs will obviously try harder and longer than others – just be patient and wait them out). When they stop trying, reward them with a treat from your other hand.
When they are doing well ignoring the treat in the closed hand you can progress to an open hand. If they try to get the treat quickly close your hand and repeat the ‘Leave It’ command – then open your hand back up. Continue to do this until they ignore the treat in your open hand. From there, you can progress placing the treat on the floor (Tip- Keep it close to your foot so you can cover it if they try to get it!). From there, you can progress to putting food on a paper plate on the floor and practice ‘Leaving it’ as well.