God's purpose has always been to bring salvation through Jesus. As soon as Adam and Eve sinned, God unfolded His plan to one day crush Satan, defeat sin, and conquer death. The problem is nobody is looking for rescue when they don't know they are in trouble. All of mankind has an incredible capacity for self-deception. We listen to Satan's lies and believe we've got it all together, We tell ourselves, "Sure, I make a mistake once in a while, but at least I'm not like __________________, they're really bad." Inside, we all have these ideas of right and wrong. Our "right" list includes all the things we tend to do well or don't struggle with. Our "wrong" list includes all the things that "they" do, which are obviously the most detestable to God. We convince ourselves that we're doing fine, but someone else may need to be saved.
Before God can save us, He has to demonstrate our desperate condition.
The Israelites were in the same condition. Surely they were good and right. After all, they were God's chosen people. He had selected them from among all the people of the earth. He had led them out of captivity under the "wicked" Egyptians. Every day, God personally led them by a pillar of smoke and a pillar of fire. When the Egyptians pursued them, God miraculously delivered them by parting the Red Sea. They had obviously been saved from their greatest need, what more could there be?
That's where the law enters. In the absence of a concrete standard, where everyone is able to define "right" for themselves, no one is ever "wrong." When we are presented with a fixed standard, however, the evaluation changes. God gives the law to reveal his expectations for us; His standards for living.
As we look at the Ten Commandments, our hearts should be laid bare. They are written to expose our sin, shortcomings, and folly. Instead, we often play the same old game. We make excuses or rationalize away the instances where we break God's laws. To vindicate ourselves, we point out the one law that we've kept, such as the infamous "I've never killed anyone." The law was never given to be a means of vindicating ourselves or steps to salvation. They were given to expose our sin and demonstrate our inability to save ourselves.
The point is not to show how many we've kept (if indeed we've kept any). The point is to recognize our inability to keep or meet any of them. In case there is any confusion, Jesus makes the matter more clear by showing us that God judges not just the external actions, but the internal attitudes and motivations that drive them. For example, you may not have taken someone's life, but if you've hated your brother, you've embraced the attitude that leads to murder when fully developed (Matt. 5:21-22).
The law reveals that we are utterly bankrupt before God. We are lost and in need of a Savior. The law was given to reveal our need for Jesus. In Galatians, Paul says, "The law was put in charge to lead us to Christ that we might be justified by faith." (Gal. 3:24) We can never live up to the standards of the law. God demands perfection and we cannot attain it. The law demonstrates that no one can fulfill it . . . except Jesus.
God came as a man, Jesus , to fulfill all the requirements of the law. Then, having shown Himself perfect and sinless, God placed on Him all of our sin (Is. 53:6). There on the cross, He who knew no sin was made sin for us, so that in Him we might become the righteousness of God (2 Cor. 5:21). Jesus died as our substitute. He fulfilled the law for us. He took the penalty for our sin. Now He offers us the ability to exchange our sin for His righteousness, our death for his life.
This exchange is made by faith. The Bible says that "If you confess with your mouth, 'Jesus is Lord,' and believe in your heart that God raised him from the dead, you will be saved." (Rom. 10:9) Recognizing that you are a sinner, but that Jesus has paid for your sin, you acknowledge Him as the Master, the director, the Lord of your life. As a result, God exchanges your sin for His righteousness. No longer are you a rebel lawbreaker. Now you are a beloved child.