It helps is your dog already knows “Leave It” for an object in your hand.
Set up a few distractions. Walk up to them, but don’t let your dog get to them. Say “Leave It.” When your dog disengages even a teeny bit from the item, click/yes and treat. The treat needs to be better than the item you are asking the dog to leave, at least at the beginning.
Its even better if after you click/yes, you step away from the object with your dog.
Another way to teach it is with luring. Instead of waiting for your dog to disengage you can say “Leave it” then stick the treat at your dog’s nose, and lure him away from the object. When he moves away say yes/click and treat.