Try self-forgiveness instead of self-punishment
If I act in a way I know was wrong, and I beat myself up for it... when I tell myself I could have done better, and I won't do it again... what I'm really trying to do is shame myself into being better next time. But positive rewards always work better!
Try self-forgiveness instead: Identify the need that was behind the way I acted and be clear that this was the reason. This simple act of thoughtfulness makes it easier to identify and be more responsible the next time around.