Proverbs 21:11 in the King James Version
When the scorner is punished, the simple is made wise: and when the wise is instructed, he receiveth knowledge.
Context
10 The soul of the wicked desires evil; his neighbor finds no mercy in his eyes.
11 When the mocker is punished, the simple gains wisdom. When the wise is instructed, he receives knowledge.
12 The Righteous One considers the house of the wicked, and brings the wicked to ruin.