Galatians 3:24:

Wherefore the law was our schoolmaster to bring us unto Christ, that we might be justified by faith.

See also:

Objection: Galatians 3:13’s “Curse” Speaks of Spiritual Death, Not Sickness or Poverty