I'm glad they got caught. That will 'teach them a lesson'! [=they will learn that they should not do that again]
We 'learned our lesson' the hard way. [=we learned from an unpleasant experience]
They studied the 'lessons' [='teachings'] of the great philosophers.
(..) Problem with the righteous... They can't shoot for shit. Making a hell of a racket, though. You wanted me. Well, let this be a lesson. - The lesson is... Oh, Jesus. Look at that! I just shot him through the neck! (..)2016 TvShow: Westworld Title: The Original Season: 1 Episode 1