To break a dog of counter surfing, it's hard to blame your dog for trying to get food whenever he can. Dogs are foragers and finding food is a self-reinforcing behavior because not only does eating the food feel really good, the very act of seeking it out strengthens the dog's desire to find their next tasty meal. Block access to places where food is left out by using baby gates or putting your dog in another room when you are cooking and/or you have company. If you are working in the kitchen and unable to use a baby gate, place a mat or dog bed on the floor and teach your dog to settle there or behind an imaginary line he cannot cross while you cook. Give your dog something to do to help him settle, an enriching and interactive toy or chew will give your dog something to do and focus on rather than trying to get the food you're making from the counter or table. Do not leave your dog in the kitchen unsupervised, each time he is successful is another opportunity for reinforcement and makes counter surfing harder to stop. Ensuring all the food your dog gets comes from you or an enriching toy on the ground will keep his paws off the counters.