Being righteous is being without guilt or sin. The unsaved are not righteous although they may be "good" defined as "following God's laws".
Philippians 3:8 (Paul speaking) "And be found in him, not having mine own righteousness, which is of the law, but that which is through the faith of Christ, the righteousness which is of God by faith:"
Jesus makes us "righteous". It's not that we haven't sinned, but that we have sinned and it's forgiven! If a person attempts to be "saved" by following the law they are "self-righteous". Jesus shouted at those who sought salvation by works! He called the Pharisees "vipers" (Matthew 22:33) and implied that they are hell-bound. To be called "self-righteous" is the most denigrating words a person can be called. A person can never be saved by works. Self-righteousness is damning!
Care must be taken in judging a person's spiritual condition. As Christians we all know this most quoted verse:
Matthew 7:1 "Judge not, that ye be not judged."
This means to not judge harshly. Judging has various meanings, the most severe meaning "condemn". We're condemning others when we harshly judge and if we do that, Jesus will judge us someday by the same scale. Luke reinforces the dictionary definition of "judge":
Judge not, and ye shall not be judged: condemn not, and ye shall not be condemned:
Telling a person that they need the Lord is loving and kind. It takes a judgment to lead to that conclusion. This is the "opinion" definition of "judge". However, when one is terse, unloving and blaming when rebuking, they are in fact "condemning". Therefore, a Christian must be careful in condemning anyone; Christian or not!
Before we are saved, being "righteous" is faux Christianity and the person is a fraud! Fraudulent Christians are hypocrites. They are Pharistical in belief! However, a Christian's feeble attempt at being "righteous" is not only our duty in honor of Jesus, but is a privilege! That's how we show God our love! As you can see from Ephesians, we once were walking outside the light of Christ. We were in darkness! Our salvation provides the Spirit of God within us. The Comforter within us helps us to be righteous. It's from God, not from our self,
Ephesians 5:8 "For ye were sometimes darkness, but now are ye light in the Lord: walk as children of light: 9 (For the fruit of the Spirit is in all goodness and righteousness and truth;) 10 Proving what is acceptable unto the Lord."
Righteousness is to bear fruit. We are to live without sinning, not by our own effort, but with the aid of the Spirit.
Philippians 1:11 "That ye may approve things that are excellent; that ye may be sincere and without offence till the day of Christ. 12 Being filled with the fruits of righteousness, which are by Jesus Christ, unto the glory and praise of God.
Jesus' sacrifice removed the "guilt" part of "righteousness". That leaves us responsible for being as sin free as we can be as mere humans. Righteousness is being Christlike:
1 Peter 4:1 "Forasmuch then as Christ hath suffered for us in the flesh, arm yourselves likewise with the same mind: for he that hath suffered in the flesh hath ceased from sin; 2 That he no longer should live the rest of his time in the flesh to the lusts of men, but to the will of God."
What is the will of God? It's that we not sin! Will we ever be sin free? No! Then, should we make no attempt to be righteous? Romans 6:11 tells us to be dead to sin! Sin is not a given. It's a choice. Each time we're tempted we make a decision to either consummate the sin or to annihilate it. Hopefully, most of the time we'll resist the temptation to sin, but being human, we will continue to submit to temptation on other occasions. Paul tells of of the his desire to be sinless, but that he sinned in spite of that desire. That's because Paul's not Jesus as we're not!
The Christian, therefore, is called to make every effort to be righteous, even knowing failure is inevitable. This is where God gives an "A" for effort! It's possible that we'll get a better "crown" (blessings) in heaven for our efforts because some scripture points that way. When we fail to be sin free, by God's grace, unlike our fellow brothers, we're not condemned. We are failing to live up to God's plan for his disciples, and are not living as God planned that we should live, being a "new man" after being "reborn".
What are Christians to do in the face of sin?
1 Timothy 6:11 "But thou, O man of God, flee these things (sins); and follow after righteousness, godliness, faith, love, patience, meekness."
Christians should never argue about the desirability of sinning. That's a given. (It is undesirable!) We should help each other through love and support! We each have our own doctrines. Some place more emphasis on being holy than do others. Whether one can apostatize by living a life of sin (rejection of Christ) is conjecture (because we understand the same scripture differently) just as the opposing position. However, just because we don't have to live under the threat of hell-fire doesn't mean that we are not to live righteously! Righteous living is a gift of God and our own response to his gift. Communion with God is bi-directional and we are to live to please Him! That's our part in our "walk in faith"!