"Yet we know that a person is put right with God only through faith in Jesus Christ, never by doing what the Law requires. We, too, have believed in Christ Jesus in order to be put right with God through our faith in Christ, and not by doing what the Law requires. For no one is put right with God by doing what the Law requires."
Galatians 2:16
Good News Translation
The scripture tells that we could only be made right with God through Jesus Christ. Notice the word "only", that means we can't be made righteous by doing good works or by obeying the law. Doing good works and obeying the law or scripture is the outcome of our faith in Jesus Christ. A person is made righteous only by believing in Christ not by doing good works or by obeying the law. For if righteousness could be attained or gained by keeping the law, then there was no need for Jesus Christ to die. Because Christ died on the cross for the people to be saved and be made righteous with God. Christ's death on the cross is the only way for us to be saved and gain righteousness through faith in Him.