To discourage garbage raiding, get a garbage can that has a locking lid. Or, simply put the garbage can in a place your dog can’t reach, like under the sink. If you attempt to correct your dog when you catch him raiding the can, chances are that all he will learn is to avoid going on a “garbage hunt” when you’re around. You’ll essentially have created an owner absent garbage hound.
Your dog has lots of reasons to want to dig. Digging is fun and it relieves boredom. To prevent unwanted digging, don’t let your dog spend unsupervised time in the yard. Go outside and watch him play or better yet, play with him.
If you don’t want to ban digging, you can teach him that it isn’t digging you hate, just digging everywhere. So, choose one spot and designate it as his digging pit. Think of it as his sandbox. Let him watch you bury a couple of tasty chew-toys. Then encourage him to dig in that spot to get them out. Your dog will learn that this is the best (and only) place for him to have his digging fun.