that'll teach

that'll teach (one) ((not) to do something)

That should serve as a lesson not to do something! Said when one receives some fitting punishment or negative outcome as a result of their actions. (The meaning is the same regardless or whether "not" is used.) My men are going round to rough the accountant up. That'll teach him to go talking to the police. A: "She's been sentenced to 10 years in prison for her involvement in the scam." B: "Good. That'll teach her." A: "Ouch! You hit me in the head!" B: "That'll teach you not to talk back to me!"
See also: teach
Farlex Dictionary of Idioms.

that'll teach someone

Inf. What happened to someone is a suitable punishment! (The someone is usually a pronoun.) Bill: Tom, who has cheated on his taxes for years, finally got caught. Sue: That'll teach him. Bill: Gee, I got a ticket for speeding. Fred: That'll teach you!
See also: teach
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs.
See also:
  • That’ll teach someone
  • that'll teach (one) ((not) to do something)
  • lesson
  • an object lesson
  • chock
  • chock full of
  • chock full of (something)
  • get (one's) lumps
  • get lumps
  • get one’s lumps
References in classic literature
something else, I hope, that'll teach those murderers a lesson," he added, shaking his fist towards the placard.
"That'll teach you that back talk don't go with me," the trader shouted, purple with rage, peering down at him over the broken railing.
"My dad was p***ing himself laughing and his words were: 'That'll teach you a lesson.' It bloody did!
My dad was p***ing himself laughing and his words were: "That'll teach you a lesson." It bloody did!
Although its classic Shehbaz to try and pin everything on poor Hamzu." That'll teach him to take my things without asking" he ended.
Maggie Mellor Less than a tenner a tree, that'll teach 'em, eh?
Stallone also shared a light-hearted video with her daughters running around as it hailed outside before turned the camera on himself and said, "That'll teach 'em".
'Well done lady, that'll teach her not to assume old people are easy targets.
Well that'll teach us to defy the money men, won't it ?
"That'll teach them for trying to save a measly 10p a week by swapping one of my sausages for a Yorkshire pudding on my weekly visit to the cafe, which has now cost them PS30 a week in lost sales.
That'll teach Si to give his mobile number out so freely.
"That'll teach you to swing off the chandelier," guffawed another.
Light up the pumpkins, hang them from his trees and then shout up at his bedroom window while dancing a deranged jig: "Oi, wake up Mr Can't-Be-Too-Careful, your garden may contain nuts!" That'll teach him.
That'll teach me for wearing stiletto heels on a cobbled street.
In September, Shed bought Twenty Twenty, the company behind Bad Lads Army and That'll Teach 'Em, and snapped up global distribution firm Screentime in 2006.