Galatians 3:21

"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.

Galatians 3:22

"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.

Galatians 3:23 - 25

"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.