Meaning of “teach sb a lesson” - Learner’s Dictionary

teach sb a lesson

to punish someone so that they will not behave badly again:

The next time she's late, go without her. That should teach her a lesson.

(Definition of “teach sb a lesson” from the Cambridge Learner’s Dictionary © Cambridge University Press)