The best thing to do if you have cats, or dogs, or even small children, is to keep the garbage out of their reach. You can put it under the sink, or hang a small bag on a doorknob or handle, taking it outside frequently. Or you can get a heavy one with a covered lid. With cats, or dogs, or kids, I have found it's actually easier to prevent the problem than to constantly nag and try to teach them something they may never completely learn or accept. Just keep stuff out of reach if you don't want it messed with, you'll save yourself a lot of aggravation.
I had a friend who insisted on leaving all her knicknacks and expensive glass items sitting down low and constantly slapped and reprimanded her toddler daughter for messing with them, saying she'd learn eventually but she never totally stopped, and never really got the message of what was and was not okay to touch (until she was old enough to understand words) Personally I'm not putting myself or anyone else through such torture. Just put it in a safer place if you're worried about it.