If anyone thinks he is religious and does not bridle his tongue but deceives his heart, this person's religion is worthless. Religion that is pure and undefiled before God the Father is this: to visit orphans and widows in their affliction, and to keep oneself unstained from the world. (James 1:26-27)
Psalm 39, one of my favorites, is a perfect illustration of what James calls the difficulty in maintaining true religion. The sentiments of this psalm work in any time period. We are always in a struggle to, as James tells us, bridle our tongues and practice pure and undefiled religion before God the Father. Remember that sin covers thought, WORD and deed, so violating God's law is not restricted to just acting. Murdering someone with your hands is prohibited, but Jesus said that being angry with your neighbor falls into the same category. All ten commandments can be broken by deed and thought. The tenth commandment is a violation of thought in and of itself. All ten commandments can be violated by word as well. So, lying is directly prohibited by the ninth commandment, but slander violates the sixth and perverted speech violates the seventh. Talking disrespectfully to your parents violates the fifth. Of course, there's blaspheming God, either directly or through bad worship. The point is that the spoken word can be just as sinful as any physical act.
So, here is Psalm 39, a wonderful psalm, and it covers the struggle that we undergo to attempt to follow God and not the world. We try to not sin with our tongues, especially in the presence of the ungodly. They will either suck us into their way of life, or they will ridicule us as hypocrites. Either way, this disrespects God. Have you noticed how our language changes, depending on the company we keep? The scriptures tell us to keep silent in the midst of the wicked. But this becomes a struggle. Even David had trouble keeping silent and "hold his peace." But his distress increased, because the world will never stop attacking us in its attempt to either suck us in or show us up. David responds to his agony with a direct prayer to God. Is the prayer for the power to keep silent? No, the prayer is for an acute awareness of how short his own life is. By being always mindful of how fleeting life is, he puts more hope in the Lord, and this sentiment culminates in the line, "I am mute; I do not open my mouth, for it is you who have done it." (39:9) Obedience to the Lord comes from maximizing the Lord himself, seeking out his glory and righteousness, and minimizing ourselves as sinners in need of salvation. When Christ's glory is made paramount, obedience to God's word necessarily follows. This is how we keep ourselves "unstained" from the world. It's not about trying harder to resist, but putting our focus on Christ and his glory, and only thinking of ourselves as wretched sinners in need of salvation.
Notice that in the practice of pure and undefiled religion before God, the qualifier "the Father" is added. Why that singular aspect of the trinity? Well, let's understand what orphans and widows means. Elsewhere in scripture, orphans are more referred to as "the fatherless." Widows are, of course, without husbands. In both cases, there is a male, guiding figure missing. We know from the scriptures that the father/husband is supposed to fill in Christ's role for the family, guiding the members in godly instruction and leading them to salvation, reminding of them the gospel of grace. Many fail in this role, but this is the godly role of the man, a great burden that holds them accountable for the well-being of their families. So, to visit widows and orphans in their affliction means what? To restore the missing Father/Husband. To show these people Christ, and to instruct them in biblical principles. To re-establish a right relationship between these people and God. With this in mind, even though we are to aid and support actual widows and orphans (as our neighbors), however this opens up the category to everyone: all are without fathers, if they don't have Christ, and all are without the guiding husband of Christ, if they are outside the true church.
So, in Matthew 25, when Christ talks about visiting the "least of these" in their affliction--clothing the naked, feeding the hungry, welcoming the stranger, giving drink to the thirsty--an implied aspect of "visiting" is sharing the gospel in order to restore the "father/husband" relationship to that person. In preaching Christ, and through the repentance of the one in need, he or she is born again as a child of God and as a member of the universal, invisible church. Just providing for the needs of the people is not enough. Without Christ preached, the ungodly remain ungodly. Christ came to save sinners. Without an awareness of sin and a need for Christ, the most physically cared-for person on earth will be lost forever.
Finally, remember that Christ himself practiced pure and undefiled religion before his Father in heaven. Psalm 39 can be read from the mouth of Christ. He visited the widows and orphans in their affliction, those widows and orphans being all of mankind, who are without the God figure in our lives. He restored our relationship with God the Father and as members of the church with Christ as the head, our husband. He restored this relationship by temporarily breaking his own relationship with the Father. That is why we see Jesus cry out in Mark 15, "My God, my God, why have you forsaken me?" He took upon him the punishment that we deserved, breaking his bond with the Father, in order to seal the bond between repentant sinners and the Father they had lost. Jesus never opened his mouth. He kept himself unstained from the world. He never tried to "play along" and he never opened his Father up to attack because of foolish talk. Jesus never sinned. He was a perfect, obedient servant. He was everything we fail to be. Thanks be to God for his grace and mercy through is Son Jesus Christ! We can be forever connected with our Father and restored to our Husband. All thanks to Christ's perfect life and redeeming sacrifice.