Here’s the KJV (Link to NIV)
26 If any man among you seem to be religious, and bridleth not his tongue, but deceiveth his own heart, this man’s religion is vain.
27 Pure religion and undefiled before God and the Father is this, To visit the fatherless and widows in their affliction, and to keep himself unspotted from the world.
For James, there are too many “religious” in name only. As far as he’s concerned, true religion has very little to do with beliefs in isolation. If you think you are going to be saved because if God gave you a theology exam you’d ace it, you’re in trouble. True religion is active. The thing that really pleases God is not what we think, but what we do (and don’t do). Do we just try to get ours, to look out for our own interests, and leave everyone else to theirs? Or do we look after others, particularly those who are least able to return the favor (orphans, widows). It is helping others without thought of ever being paid back.
Do you think of others first or yourself? Do you help others because you think that someday someone might help you if you need it, or because of some other reward, or do you help others out of genuine self-sacrificing love?