My last post might seem to come down pretty hard on God's law. I have actually been summarizing Paul's comments. So let me move to Galatians 3:21a, "[Is] the law then against the promises of God? God forbid".
So what is the purpose of the Law? It is not (directly) for our salvation. This is the misunderstanding of the legalist.
Psalm 19:7 "The law of the LORD [is] perfect, converting the soul". Galatians 3:24, "Wherefore the law was our schoolmaster [to bring us] unto Christ, that we might be justified by faith." And there it is.
The Law has been compared to a mirror, which shows us our true selves. Our self-image is one of self-righteousness. "I am a good person." "I am much better than most people." "I'm not a murderer." "I try to live a good life." "Of course God loves me, I'm great!"
But when we look into the Law, we discover we are not good in God's sight. God sees everything we've done, and all our thoughts. Jesus said it is our thoughts which make us unclean, even more than deeds. Because our thoughts determine who we are.
Romans 3:12b "there is none that doeth good, no, not one."
If we agree with God that we are not good, we see our need for a savior. If we humble ourselves, cry out to God for what we have done, turn our backs on our old lives, and trust in Jesus to save us -- we can be saved.