Dogs are attracted to the trash can because it offers such tasty temptations. While you may not think last night's leftovers or some used tissues are enticing, your dog probably disagrees. Your dog may initially nose around in the trash out of curiosity, boredom or because a particularly good smell attracts him, but once he develops the habit, it is a real challenge to change his behavior.
Make it difficult for your dog to access the trash. Select a trash can with a foot-activated pedal for the lid or move your trash under the cabinet. This is the simplest way to stop the trash-diving behavior. Of course, many dogs are persistent and will figure out a way to access the trash even if you change the set up, and you may have reasons you don't want to change out your trash can style or location.
Put tempting scraps into an outdoor receptacle. If you have steak, chicken or some other extra tasty morsel, tie the trash bag shut and take it directly to your outdoor can to wait for pickup.
Supervise your dog closely, so you can catch him in the act. Disciplining your pup when you walk into a kitchen that has trash strung from one end to the other will not teach your dog anything and only cause you more stress. Supervise your dog carefully when he is loose in the house until the problem is corrected. Each time he even acts interested in the trash, clap your hands and tell him "no."
Build a trap for your dog so he learns to stay away. Blow up several long balloons, over-inflating them a bit so it won't take much to pop them. Use double-sided tape to secure the balloons to the inside of a trash can where you have left a smelly, tasty scrap. Leave the room and allow your dog to find and explore the trash. When he starts rooting around, the balloons will pop, surprising him and hopefully teaching him to stay out of the trash. The double-sided tape will keep the popped balloons from going everywhere, but you still need to do this when you are around so you can clean up the mess before your dog calms down and comes back to investigate.