teach somebody a lesson

teach somebody a ˈlesson

(also ˈteach somebody (to do something)) learn from a punishment or because of an unpleasant experience, that you have done something wrong or made a mistake: He needs to be taught a lesson (= he should be punished).Losing all his money in a card game has taught him a lesson he’ll never forget.That’ll teach you! Perhaps you’ll be more careful in future!
See also: lesson, somebody, teach