Use the word "lesson" as a noun when talking about learning experiences that are part of a formal education. Here are some examples:
The teacher prepared a lesson for the students.
Vanessa took notes during the lesson.
What did she learn from the lesson?
What did you learn from your English lesson?
Do you pay attention during a lesson?
There are hundreds of lessons on this website.
It’s easier to learn how to play a musical instrument if you take lessons.
Children who take piano lessons learn how to play the piano.
Tom has been taking guitar lessons because he wants to play in a rock band.
The word "lesson" is also used for any kind of experience that’s not part of school but from which a person has gained knowledge:
Driving too fast and then getting a ticket for speeding taught Dan a lesson.
That was a hard lesson to learn.
Lesson learned!
Before the man spanked his son he said he was going to teach him a lesson.
What kind of a lesson is learned when a person is punished?
Lessons learned in life are valuable.
That was a valuable lesson.
When will I ever learn my lesson? (This is a type of expression. It means that a person does something wrong without thinking about how past similar experiences were negative.)