This article is from the Dog Behavior FAQ, posted to rec.pets.dogs newsgroup. Maintained by Cindy Tittle Moore with numerous contributions by others.
You should train your dog away from this habit. Crate it, to keep it out of the garbage when you are not home, and correct it when it gets into it when you are at home. This works best if you start in puppyhood.
If you already have this problem, some approaches to try: * You can get "Mr. Yuk" labels and put them in the trash to keep them out of it or spray Bitter Apple into it. But you have to remember to do this regularly. If you can, put the trash out of reach of the dog, eg, under the sink. You may need to get the kinds of trash cans that have closing lids. Don't start easy and work your way up as the dog figures each one out: you are just training your dog how to open garbage cans. Get a good, well secured one at the start. * Get some jalapeno peppers, or something that your dog REALLY HATES. Slice them up and spend some time wrapping each one individually in tissues or kleenex. Fill the trash can with the wrapped surprises and let your dog at it. A few days of this should convince your dog that trash cans are not fun. * Put a mousetrap in the bottom of an empty can, cover it with newspaper, then put something that the dog really likes in the can and leave the room. Only do this when you are around, do not trap all the trash cans and then go off to work for the day!
 
Continue to: