idiom
teach someone a lesson
Meaning
to make someone learn from their mistake
Example
The teacher’s punishment really **taught him a lesson**.