Ah you have my sympathy! Unfortunately digging through the garbage and getting "stinky goodies" has become a reward for your pup. It's basically similar to stealing unattended food off of the kitchen table. My boy, Oscar, recently discovered the art of trash-diving when a piece of salmon was thrown out. We have a lidded garbage can, but it just proved too enticing for him to pass up!
I've had to resort to keeping him in my room while I'm gone and also just hiding garbages/making them inaccessible to him. As much as we love them, and subconsciously personify them, we do have to remember that they are animals, and driven by instinct. I would guess that you may have to continue to just keep these garbages inaccessible. One trick is to put a brick on the bottom (outside of the bag) to make it harder to tip over. Otherwise, the only thing I can think of is negative reinforcement, but we of course don't want the garbage can to become a big, scary monster that makes them nervous, either! Maybe try spraying bitter apples or even sprinkling a bit of hot sauce on some tissues on top so they become less of a reward?
Overall, preventing a disaster before it can even occur may just be your best bet. Sorry I can't offer definite hope that he will grow out of this
Good luck and please feel free to share any tricks you try that seem to help! I would also love a way to beat this