an object lesson

an ˈobject lesson

a practical example of what you should or should not do in a particular situation: It was an object lesson in how not to make a speech. He did absolutely everything wrong.An object lesson was a school lesson that used real objects as a way of teaching in a very direct and practical way.
See also: lesson, object