When training animals, particularly dogs, it's (I think) pretty well-known that redirecting to positive behaviors is much more effective than punishing unwanted behaviors (so much so that one could say "punishment does not work at all compared to redirecting to desired behaviors" without much exaggeration). i.e. when a dog chews on a sofa cushion, put a dog chew in their mouth or direct them to go get their toy or chew or whatever. When they jump up on people, put them in a sit-stay, then you can praise them for doing a good thing. This is just a human, self-directed, version of that, I think.
I'm not saying people are like dogs, but...people are kinda like dogs.
I'm not saying people are like dogs, but...people are kinda like dogs.