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.
(..) but when I finally had enough, I went to the store and it was gone. They had just sold it to someone else. So, I went home and I told my mother. She said, "Let that be a lesson. That's the good that comes from wanting things." She was really good at dispensing life lessons, (..)2018 TvShow: BoJack Horseman Title: Free Churro Season: 5 Episode 6