A smelly garbage can be an irritant. Luckily, with a little vinegar and a piece of bread, you can quickly get rid of any foul smells coming from your garbage can. Pour some vinegar onto a piece of bread, enough to almost soak it, and then just toss the bread into the garbage can. This solution can actually be used for any space where you're noticing odors but it works best for the garbage can since you can easily just leave the bread in the trash.
You can also just soak a sponge in vinegar and toss it, but a piece of bread is much cheaper, and you probably won't mind tossing it as much as you would a perfectly good sponge.