teach somebody a lesson
teach (one) a lesson
To punish or harm someone as a means of seeking retribution and to dissuade or prevent them from committing bad behavior in the future. After the CEO was found guilty, he was forced to repay $150 million in damages and will spend the next 10 years in jail. If that doesn't teach him a lesson, I don't know what will. A: "I heard Jeff crashed his new Porsche into a streetlight." B: "Well, that ought to teach him a lesson about constantly speeding in a residential area."