Righteousness has nothing to do with doing good works, though good works are a byproduct of being righteous. Jesus spoke of God as the only one who is truly good. The word good is a synonym for righteous, so it follows that to be righteous is to be like God. Righteousness, meaning to be right or just, begins with believing God. God's formulas are so simple that we ignore them because we think there must be more to it than that.
All sin is rooted in unbelief.
All righteousness is rooted in belief. Believe God for all His promises and He will count it unto you as righteousness. Believe on the Lord Jesus Christ, God's ultimate standard and incarnation of righteousness, and be saved. Believe in Jesus Christ to deliver you in your day of trouble and learn what the righteousness of Christ can do in and through you. Based on this passage, explain what is required to be right with God.