teach someone a lesson

-naučiti koga lekciju, urazumiti koga

John tripped me, so I punched him. That ought to teach him a lesson.
That taught me a lesson. I won’t do it again.
The next time she’s late, go without her. That should teach her a lesson.