idiom
teach someone a lesson
hacer que alguien aprenda de su error
Meaning
to make someone learn from their mistake
Example
The teacher’s punishment really **taught him a lesson**.
El castigo del maestro realmente **le enseñó una lección**.