i had problems with my dog getting into the trash a number of years ago. it got to the point that she was starting to get scared when i came home from work because she was associating my arrival with being punished.
a much heavier trash can that she couldn’t knock over. problem solved.
now, however, i keep the trash in a special cabinet that was installed recently so, unless my dogs develop opposable thumbs, there’s no way they can get to it.