I taught my dog to keep his nose off the counter with snappy mouse traps. Only took once. It didn’t catch him, just scared the bejeebers out of him.I know right!!!!
I stick mine in the microwave (aka dog proof space)
Food left on the counter here for more than 3 minutes is considered fair game by 3 of the dogs.