You turn to rinse a pan, and the sandwich is gone. Your dog got an immediate reward from the counter, even if you didn't mean to offer one. A sharp "no" after the fact will not make the next unattended sandwich less tempting.

The first fix is ordinary and unglamorous: clear the reachable surfaces. Put food away, wipe up crumbs, and block access to the kitchen when you cannot supervise. While cooking, use a gate or a comfortable space elsewhere if your dog cannot yet leave food alone. That is not a permanent verdict on their manners. It stops the counter from paying them while you teach something better.

Give your dog a job during cooking

Away from food, teach "go to your mat." Place the mat a little outside the busy kitchen, reward a step onto it, and gradually reward staying there for a few seconds. Release your dog before they wander off, build time slowly. Then practice while you move an empty pan around. Only after that, bring food into the scene. If your dog keeps leaving the mat, you may have made the step too hard or asked for too long.

You can also teach "leave it" with easy practice items on the floor and reward your dog for turning away. Don't begin by leaving dinner on the counter as a test. Real food at nose height may be much harder than a treat in your closed hand.

If your dog takes food, calmly secure whatever remains and check what they ate. Chocolate, grapes, raisins, xylitol and some other foods can be dangerous to dogs, if there is any chance of a toxic ingestion, call your veterinarian or an animal poison service promptly. Do not wait for symptoms or try a home remedy.

A clean counter and a dog resting behind a gate are a good day. Training can be slow because one jackpot from the worktop can keep the search alive. Be consistent, not angry. For a broader look at the routines that keep training steady, see the everyday dog-training habits guide, clearing the counter is still the first step

Sources: Best Friends Animal Society: Dog Counter Surfing - Prevention and Deterrents. American Kennel Club: How to Train Your Dog to Stop Counter Surfing.