Proverbs 19:25

19:25 Flog a scoffer, and the simple will learn prudence; Rebuke one who has understanding, and he will gain knowledge.
-World English Bible

Other Translation

19:25 Smite a scorner, and the simple will beware: and reprove one that hath understanding, [and] he will understand knowledge.
-King James Version