Psalm 94:12 in the King James Version
Blessed is the man whom thou chastenest, O LORD, and teachest him out of thy law;
Context
11 The LORD knows the thoughts of man, that they are futile.
12 Blessed is the man whom you discipline, LORD, and teach out of your law,
13 that you may give him rest from the days of adversity, until the pit is dug for the wicked.