If Fido seems obsessed with sniffing everything from the grass to other dogs and people's crotches, realize that this is his way of getting information. Your pet companion's sniffing can tell him whether you've had a good or bad day, it can inform him about the gender and health of other dogs, and it can even predict which flowers are about to bloom in the garden. Don't get angry at Fido's sniffing habit -- if your sense of smell was as good as his, you'd probably be sniffing all the time too. With patience and consistency you can teach him right from wrong so you can stop unwanted sniffing when you have to.
Teach your dog the "leave it" command. Leash your pet companion and place a dog treat on the table. When your dog notices the irresistible treat and sets in for the attack, lightly tug the leash and say "leave it." If your dog still attempts to go for the treat, tug the leash again and firmly command him to "leave it." When you get his attention, praise him and show him a dog toy to distract him. When he shows interest in the toy, praise him some more to reinforce the good behavior. Repeat this tactic several times until your dog learns the meaning of "leave it."
Train your dog to "sit" on command. When your pet companion is standing upright, hold a dog treat about 1 inch above his nose. When your dog moves his nose up to smell the treat, say "sit" and move your hand backward over his head. This makes your dog sit down so he can follow the treat with his eyes. When he's sitting down, give him the treat. Repeat this several times in different locations both indoors and out, and gradually reduce the frequency of the treats. Eventually he'll sit on command in anticipation of the dog treat he might get.
Watch your dog like a hawk so you can catch him before he starts sniffing. If he's eying an object he wants to sniff, or moves closer toward it, say "leave it." When your dog looks at you, tell him to "sit." Praise and reward him when he listens.
Startle your dog when you catch him sniffing an inappropriate object. Shake a can of coins or blow a whistle to stop your pet companion in his tracks. When he stops sniffing, show him a dog toy to distract him, and praise him when he starts playing with it.
Give your dog and his nose a workout, because if your dog is tired, he's less likely to sniff objects that are off-limits. Take him on walks so he can explore his surroundings and sniff as much as he wants. Periodically change the route you take so he can smell different scents. When at home, give him a food-stuffed dog toy to challenge him and to keep his nose busy. Alternatively, scatter his food in the backyard so he has to sniff around the grass to find it.