James 4:17

Therefore, he who knows that he ought to do a good thing, and does not do it, for him it is a sin

Other versions

King James Version

Therefore to him that knoweth to do good, and doeth it not, to him it is sin.

English Standard Version

So whoever knows the right thing to do and fails to do it, for him it is sin.

New International Version

Anyone, then, who knows the good he ought to do and doesn't do it, sins.