Just about the surest way to erode behavior is to punish it. After all, that's what punishment is defined as: a consequence for behavior that makes that behavior less likely to happen in the future.
In reward based training, we emphasize avoiding punishing bad behavior whenever possible and instead focus on rewarding good behavior, for a lot of good reason that I won't go into here. However, something that catches a lot of owners is when they end up punishing their dog for responding to a command! They "poison" the command (or cue, in trainer parlance).
"What!?! Why would anybody punish their dog for being good? I would never do such a thing!"
Really? Wouldn't you?
"No!"
Wouldn't you?
"Um... No?"
Wouldn't you?
"What do you want from me?!? I'm a monster, aren't I?"
Okay, calm down. But honestly, it's easier to accidentally punish a dog for good behavior than you may realize. Here's a common one - dogs who, when playing in the backyard or the park, only hear the "Come" command when it's time to come inside or leave - so that when they come, they get punished by having their playtime end! Before long, you end up with a dog that will absolutely ignore you in the yard or park, because it's in their own best interest to do so. We call this a "poisoned cue" - the dog has been taught the opposite of what we really want the command to mean.
A lot of times, the solution is simple. Start getting into the habit of calling your dog to several times when they're in the yard or park, reward them for coming to you, and then send them right back out to play! When it's time to actually go, you can either call them, reward them and then take them away/inside, or you can just go walk to them and leash them up without using the Come command. Either way, most of the time they hear the Come command, it will be purely positive - a reward followed by even more playtime. Which will pay off when there is actual danger and you need your dog to come to you now.
(Sometimes, though, the cue has been so "poisoned" that it's become unsalvageable. Owners who see their dog digging up the roses, call them over with "Come", and then yell at or swat them may find that no amount of rewarding "Come" later will ever get it up to a good level again. In that case, we just start training a new command that will mean the same time, but making sure we leave all potential punishments out of it this time around.)
A more subtle and even more common example, though, is that a lot of owners just love to reach down and scrub their dog's head when they're happy with them. "Good job, Max!" they say as they rub their hand all over Max's head like he was a precocious toddler. Here's the thing, though - most dogs hate that. It's like the aunt who would pinch your cheeks at family get-togethers. Sure, you loved her and she loved you, but you didn't want to walk up to her, did you?
It's the same thing with the head scrub. When your dog gives you a nice prompt Sit, and you reach down and scrub their head in a manner they find deeply annoying and offensive, you've just punished them for behaving. Do it a few times, and pretty soon your dog will be very reluctant to sit for you on command. Even if you're using treats as rewards, at best you're just creating a conflicted dog, torn between annoyance and appetite.
And I gotta tell you, it is HARD for owners to break themselves of that habit, even when it finally clicks and they realize how much it's been eroding their dog's obedience. So if you recognize yourself in this example? Just strive to do better and recognize that you'll probably screw up a few dozen times and keep reaching down to scrub that head, but if you keep at it eventually you can stop yourself. And in the meantime, use that awareness of how difficult it is for you to stop doing such a simple act to gain a little appreciation of how hard it can be for your dog to control their behavior sometimes, yes?