James 2:10 “For whoever keeps the whole law and yet stumbles at just one point is guilty of breaking all of it.”
When a person stands before a judge in court, the judge is not trying to figure out how good a person is but how guilty an person is. One violation of law requires the judge to declare guilt and a punishment. It is similar with God. Just one violation of His law determines us as guilty in the same way as if we broke all the laws. Good human judges cannot be bribed and neither can God.
Deuteronomy 10:17 “For the LORD your God is God of gods and Lord of lords, the great, the mighty, and the awesome God, who is not partial and takes no bribe.”
A good human judge does not overlook punishment and neither does God.
Proverbs 11:21 “Be sure of this, God will not let the guilty go unpunished.”
But you say, “I’m so good (self-righteous).” Many criminals don’t think they are bad people either. But it does not matter – it only matters what the judge thinks. What does God think of our good works?
Isaiah 64:6 “…all our righteous acts are like filthy rags…”
It is not our goodness that saves us but God’s goodness and grace.
Ephesians 2:8-9 “For it is by grace you have been saved, through faith – and this not from yourselves, it is the gift of God – not by works, so that no one can boast.”
For a more detailed explanation why goodness does not save, read the first lesson of Why Jesus available in the sidebar for free.