Quick and clever pups will find a way to scavenge unless you take a few precautions. If your puppy is old enough, you might consider teaching him the ‘No' command. There are plenty of books and videos which will show you how to use treats to encourage or discourage specific doggy behaviors, though you will, of course, require some patience!
You might also consider:
Keeping him on a leash when you go for a walk together, so he doesn't run off to the garbage;
Understanding the warning signs that he's about to start scavenging (straining on the leash, sniffing around the trash, poking at shopping bags or similar). Then, you can either remove your puppy from the situation or remove the temptation;
GPS monitors, which can be used to create fences around small areas such as garbage cans; and
Going out for walkies after your puppy is full, so he is less inclined to look around for food.
Hope this helps!