When you confess with your mouth that Jesus Christ died for your sins and believe in your heart that you are justified by faith, then you are saved and made righteous.
Romans 5: 19
“For just as through the disobedience of the one man the many were made sinners, so also through the obedience of the one man the many will be made righteous”.
Through one man sin brought condemnation for everyone, through an act of righteousness, Christ brought justification and life for all men.
Death came through Adam because of disobedience and sin, but the gift of grace came through Christ, for all have sinned and fall short of the glory of God.
Through the disobedience of Adam which brought sin, Christ brought righteousness through an act of obedience so that grace might reign through righteousness for eternal life.
Righteousness is obtained through faith in Jesus Christ and not by works, as we do not operate under the law but through faith, yet we still uphold the law (Romans 3: 31).