this is of course the tricky bit. Spot the child being good and reward it. However if what you are trying to do is drastically reduce the frequency of a behaviour then the only thing to do is go cold turkey.
Imagine a cat who is used to being given a little snack every time a human walks into the kitchen. Cat of course makes a pest of itself, winding itself around ankles and trying to trip up humans whenever ankles appear in the kitchen.
If you want cat to stop it, you throw all the snacks in the bin and don't buy any more. Feed cat, in bowl, in yard. Never give cat any food in kitchen. The begging will stop quite quickly. If you wanted to train cat into another behaviour e.g. sitting sweetly and hopefully in the corner, it would be quite tricky. Not impossible but would probably require one, focussed person behaving in a structured way to pull it off.