Galatians 3:19-24 CEB
So why was the Law given? It was added because of offenses, until the descendant would come to whom the promise had been made. It was put in place through angels by the hand of a mediator. Now the mediator does not take one side; but God is one. So, is the Law against the promises of God? Absolutely not! If a Law had been given that was able to give life, then righteousness would in fact have come from the Law. But scripture locked up all things under sin, so that the promise based on the faithfulness of Jesus Christ might be given to those who have faith. Before faith came, we were guarded under the Law, locked up until faith that was coming would be revealed, so that the Law became our custodian until Christ so that we might be made righteous by faith.