Galatians 3:21-25 NKJV
Is the law then against the promises of God? Certainly not! For if there had been a law given which could have given life, truly righteousness would have been by the law. But the Scripture has confined all under sin, that the promise by faith in Jesus Christ might be given to those who believe. But before faith came, we were kept under guard by the law, kept for the faith which would afterward be revealed. Therefore the law was our tutor to bring us to Christ, that we might be justified by faith. But after faith has come, we are no longer under a tutor.
NKJV: New King James Version