Galatians 3:21-23

21 Is the Law then contrary to the promises of God? Certainly not! For if a system of law had been given which could impart life, then righteousness (right standing with God) would actually have been based on law.

22 But the Scripture has imprisoned[2] everyone [everything—the entire world] under sin, so that [the inheritance, the blessing of salvation] which was promised through faith in Jesus Christ might be given to those who believe [in Him and acknowledge Him as God's precious Son].

23 Now before faith came, we were kept in custody under the Law, [perpetually] imprisoned [in preparation] for the faith that was destined to be revealed,