"What, then, was the purpose of the law? It was added because of transgressions until the Seed to whom the promise referred had come. The law was put into effect through angels by a mediator. A mediator, however, does not represent just one party; but God is one." NIV translation
The law was given and put into effect to point us to the need for a Savior which is Jesus Christ. A mediator is someone who gets between two parties to help them to settle their differences and that is just what Jesus did for us. He made a way for us to be reconciled to God and that was the fulfillment of God's promise to Abraham.
"Is the law, therefore, opposed to the promises of God? Absolutely not! For if a law had been given that could impart life, then righteousness would certainly have come by the law." NIV translation
The law is like a signpost along the highway. It doesn't actually take you to where you want to go but it tells you where you are at and where you are headed.
It is the same with the law. It can tell you the same things but it has no power to make us right with God.
"But the Scripture declares that the whole world is a prisoner of sin, so that what was promised, being given through faith in Jesus Christ, might be given to those who believe." NIV translation
The entire world is full of sin but God promised that we would be saved from it. That promise is fulfilled through our faith in Jesus as the perfect atoning sacrifice for that sin.
"Before this faith came, we were held prisoners by the law, locked up until faith should be revealed. So the law was put in charge to lead us to Christ that we might be justified by faith. Now that faith has come, we are no longer under the supervision of the law." NIV translation
Jesus was the perfect sacrifice because He kept the entire law on our behalf. We were prisoners of that law because we were unable to keep it on our own. When we accept by faith that Jesus took the penalty for us, we are no longer under the threat of penalty or controlled by the law. Its only purpose was to point us to the need for Jesus Christ.