James 4:17 (ESV) … “So whoever knows the right thing to do and fails to do it, for him it is sin.”
Much of God’s will is revealed in the Scripture. We are held responsible to know what God says about all of the great issues of life. We are held accountable to bring our wills under the supreme authority of God’s will. God holds us just as accountable for what we do not do as for what we do. Indeed, at the great coming judgment of the nations in the Valley of Jehoshaphat, at the return of Christ, that will be the whole criteria for those who are condemned (Matt. 25:41–46).
Years ago, when my children were still young, our daily family devotions brought us one evening to this verse: “To him that knoweth to do good, and doeth it not, to him it is sin.” I explained that it was just as bad not to do a good deed as it was actually to do a bad one. I posed an example.
“Suppose that you came in from school one day and saw your mother lying on the couch, exhausted and unwell. Then you went into the kitchen and saw that the sink was full of dirty dishes. What would you do?”
My young son responded at once. He said, “I’d give her some Geritol (a much advertised patent medicine) for iron-tired blood!” We laughed! But that was not the answer I had expected, and it wasn’t what James had in mind.
The classic New Testament illustration is found in the Lord’s parable of the Good Samaritan. The unfortunate traveler on the downward Jericho road had fallen among thieves. He had been beaten, robbed, and left by the roadside half dead.
Along came a priest—Jericho was a bedroom community for many of the priests. This man was on his way home from Jerusalem, where he had been attending to his religious duties. He had been handling holy things, officiating at the altar, advising people regarding their sacrifices, helping them with their offerings. He might even, perhaps, have had his turn ministering in the sanctuary itself. His mind had been occupied with his religious duties. If ever a man knew to do good, surely this was the man. He could not help but see the wounded man. What did he do? Nothing! He “passed by on the other side.” He wrapped his robes about him and scuttled past on the opposite side of the road. This man was a hypocrite. James has the word for him: “Pure religion and undefiled before God and the Father is this, to visit the fatherless and widows [and beaten-up travelers!] in their affliction” (James 1:27).
Then along came a Levite. In New Testament times, the Levites were the experts in the law. If ever a man knew to do good, it was him. He spent his whole life studying the Scriptures, especially the Mosaic Law. He knew, for instance, the law that stated,
Thou shalt not see thy brother’s ox or his sheep go astray, and hide thyself from them: thou shalt in any case bring them again unto thy brother. And if thy brother be not nigh unto thee, or if thou know him not, then thou shalt bring it unto thine own house, and it shall be with thee until thy brother seek after it, and thou shalt restore it to him again. In like manner shalt thou do with his ass; and so shalt thou do with his raiment; and with all lost thing of thy brother’s, which he hath lost, and thou hast found, shalt thou do likewise: thou mayest not hide thyself. Thou shalt not see thy brother’s ass or his ox fall down by the way, and hide thyself from them: thou shalt surely help him to lift them up again. (Deut. 22:1–4)
In fact, the Mosaic Law went even beyond the preceding statement. The Hebrew was to do as much for an enemy: “If thou meet thine enemy’s ox or his ass going astray, thou shalt surely bring it back to him again. If thou see the ass of him that hateth thee lying under his burden, and wouldest forbear to help him, thou shalt surely help with him” (Exod. 23:4–5).
The Levite knew all about these commandments of the law. Now, here at hand, was an opportunity for him to put to work what he knew. The fallen man was of far greater worth than an ox or a sheep. The law commanded him to do a good work. What did he do? He crossed over the road, took a good look at the poor man, crossed back over the street, and “passed by on the other side.” This man’s religion was as vain, empty, and futile as that of the priest. It took a journeying Samaritan, a man whom both the priest and the Levite would have despised, to show true religion and true good works by helping the man in his need (Luke 10:1–37). James would have approved of the Lord’s parting shot: “Go,” He said to the lawyer who had been heckling Him, “and do likewise.” 
 Phillips, J. (2009). Exploring the Epistle of James: An Expository Commentary (Jas 4:17). Kregel Publications; WORDsearch Corp.