Distilled parenting wisdom has it that discipline helps kids and teenagers understand limits, have a sense that caring adults are watching out for them, and that the world has some order. Punishment makes them feel bad about themselves and more out-of-control. Tim Elmore makes the point again in Huffpost and has research findings from the University of Pittsburgh which he says back it up. But discipline and punishment can look very similar. Just calling something a consequence doesn't make it nurturing limit-setting. When you are a parent or teacher, frustrated with a young person who has failed to follow the rules, it can be really hard to know if what you are doing is discipline or punishment (this assumes that the rules are reasonable).
Elmore points out a really good way to distinguish between punishment and discipline if you aren't sure: future-oriented versus past-oriented. If you want to discipline a kid, ask yourself, "Is what I am thinking about doing (grounding, taking away a privilege, ignoring the behaviour, giving a warning) going to help this kid do better in the future?" Punishment tends to be more backward-looking, while discipline is about doing it differently next time. This takes some self-knowledge ("Am I acting out my anger or frustration or fear about what happened?") and some knowledge of the kid ("Is this consequence likely to help her -- in all her wonderful, infuriating uniqueness -- make a change?"). Sometimes just calling the question can help. "I want to figure out what we need to do that is going to help you do it right the next time."
One final note: as with all "parenting" expertise, if, after a fair try, this tool leaves you feeling tied up in knots it should probably be jettisoned. Being confident with your child or students is important and the parento-advice industrial complex can sometimes rob parents and educators of that. Go forth and conquer, gently!