From the example of Abraham, you can realize that it is because people do good things that God considers them to be righteous, and not only because they trust in him.