"If ye know that he is righteous, ye know that every one that doeth righteousness is born of him."
I John 2:29
There is no doubt as we reach this point of John's letter to the saints of God that Jesus Christ is the only Righteous. Man can do nothing of his own accord. Even mans best efforts are considered as a filthy rag before Holy God. It has been rightfully said that the best of men are men at best and our only hope of righteousness is that which is graciously supplied by Christ.
When we see someone diligently working good works for their own salvation we know without doubt they are not righteous. They are instead denying the righteousness of Christ and are yet still dead in their sins. It has never been disputed that dead men can do nothing. No activity. No work nor play. Not any one thing can be attributed to those who are dead except that they are dead and void of life.
Thus we know that when John tells us those who do righteousness are born of Christ we know he is talking about those who walk by faith in Jesus' Righteousness alone. They have the Spirit dwelling within them and their works are done by faith so that all glory is given to God, not as of themselves but as fruit brought forth of the spirit. They have eternal life through Jesus Christ.
Are you without hope, vainly trusting your own works? Jesus Christ is the only righteous. Trust Him and learn of Him. He is the way, the truth, and the life. No man may dwell in the presence of God except the righteousness of Christ is clothed upon him. Jesus commands all men to repent, to turn from their sins, and trust Him. Please obey, so that on that day when you see Him as the Son of God you may not be fearful and ashamed, but welcomed into Paradise.
Consider also: Isaiah 64:6-8; John 14:6