Why then the law? It was added on account of transgressions, until the descendant should come to whom it had been promised, having been ordered through angels by the hand of a mediator.
References for Galatians 3:19
Now the mediator is not for one, but God is one.
Therefore [is] the law opposed to the promises of God? May it never be! For if a law had been given that was able to give life, certainly righteousness would have been from the law.
But the scripture imprisoned all under sin, in order that the promise could be given by faith in Jesus Christ to those who believe.
References for Galatians 3:22
But before faith came, we were detained under the law, imprisoned until the coming faith was revealed.
So then, the law became our guardian until Christ, in order that we could be justified by faith.
But [after] faith has come, we are no longer under a guardian.
References for Galatians 3:25