Passage
To him therefore that knoweth to do good, and doeth it not, to him it is sin.
To him therefore that knoweth to do good, and doeth it not, to him it is sin.
James 4:15 For that ye ought to say, If the Lord will, we shall both live, and do this or that.
James 4:16 But now ye glory in your vauntings: all such glorying is evil.
James 4:17 To him therefore that knoweth to do good, and doeth it not, to him it is sin.
The verse centers on "therefore", "knoweth", "good", and "doeth". It is saying that the verse draws attention to "therefore" and "knoweth", so its meaning should be read from those terms before moving to application.
The prior verse says "But now ye glory in your vauntings...", giving immediate footing for "therefore" and "knoweth". In James context, the local focus is Christ, faith, and discipleship.
A plain takeaway is to answer the verse's own emphasis on "therefore" and "knoweth" with trust shaped by these words, not by a vague optimism outside the passage.