A selection of verses showing how we can be righteous or "right with God".
The apostle Paul is quite clear that left to ourselves we aren't "right with God" or "righteous":
10 As it is written,
“There is no one righteous;
no, not one.
Abraham is the great Bible example showing that we can be right with God by believing he can do what he says:
5 The LORD brought him outside, and said, “Look now towards the sky, and count the stars, if you are able to count them.” He said to Abram, “So your offspring will be.” 6 He believed in the LORD, who credited it to him for righteousness.
Paul confirms that we follow the example of Abraham and become "right with God" by believing God will do what he says:
20 Yet, looking to the promise of God, he didn’t waver through unbelief, but grew strong through faith, giving glory to God, 21 and being fully assured that what he had promised, he was also able to perform. 22 Therefore it also was “credited to him for righteousness.” 23 Now it was not written that it was accounted to him for his sake alone, 24 but for our sake also, to whom it will be accounted, who believe in him who raised Jesus, our Lord, from the dead, 25 who was delivered up for our trespasses, and was raised for our justification.