In order to keep wild animals away from your garbage can, you simply need to place the garbage in a can that has a secure lid and keep the lid closed. Not very hard to do, but sometimes difficult to remember every time.
The very best way is to make sure you put the garbage in a tightly secured garbage bag and then inside a trash can with a tight fitting lid. Also put a large rock on the top of the can.