According to Paul, today's passage contains one of the most important verses anywhere in all of Scripture. In fact, he spends almost an entire chapter in Romans as a commentary on verse 6. Let's see the context leading up to it, then let's see how it applies to us.
God promises Abram many heirs, as numerous as the stars in the sky. City dwellers who suffer from light pollution might not appreciate this as much as they should. Speaking as one who's seen a starlit desert sky (not too far from where this promise was made), I can personally testify that this starlight is so bright that one can almost read a newspaper by it.
God makes his promise, Abram believes him, and the Lord “[credits] it to him as righteousness” What does this mean? Imagine your good acts and evil acts are like a ledger or budget page. On one side are your good qualities and actions (which in this illustration would be the income side), while on the other side are your bad qualities and sins (which would be the debit side). That's the way every other religious faith out there sees our relationship with God or Karma or whoever or whatever they believe in: If your "good" side outweighs your "bad" side at the end of your life, you're fine. If your "bad" side outweighs your "good" side, then you're in trouble.
But that's not what the Bible teaches at all. The problem is that our goodness doesn't "make up" for our bad side at all. If you have one wrong thing on the "bad" side, you stand condemned before him. His standard is not "more good than bad": His standard is perfection. His holiness is such that he cannot overlook our sin, no matter how many good deeds we accomplish. “All of us have become like one who is unclean, and all our righteous acts are like filthy rags." “If you, Lord, kept a record of sins, Lord, who could stand?” So how was Abram counted as righteous before God?
The answer is found in today's passage, and it's explained further in the Romans citation above. Abram believed God's promise, and the Lord counted it towards his "account" as righteousness. This means that in spite of all of Abram’s failures (and we’ll see many more in the chapters to come), God puts on the other end of the ledger not Abram’s obedience, but his trust. Since we can't be accepted by him based on our good works, the only way to come into his presence is based on his grace and mercy, brought to fulfillment in Jesus. We simply place our trust in him, and he credits it to our account as righteousness. This is precisely why Paul calls him “the father of all who believe,” and I highly recommend reading all of Romans chapter 4 to get the full context of the importance of this one little verse.
Why does this relate to us? Because, as Paul says, Abram is the father of all who believe, both circumcised (Jew) and uncircumcised (Gentile). By placing our faith in the God of Abraham (as revealed in Jesus Christ), we're the spiritual heirs of Abraham. The righteousness that Abram had, we have. When Abram was looking up at the night sky, one of those stars represented you.
Lord Jesus, I trust you alone for salvation. You alone can make the foulest soul clean, you alone can cover my sin with your precious blood. You are my only hope, but in you I am completely secure. Thank you.