Gal 3:16-19, 21-22
God gave the people of Israel a law so that they lived by this law. (Deut 5:31)
Deut 5:31 But as for thee, stand thou here by me, and I will speak unto thee all the commandments, and the statutes, and the judgments, which thou shalt teach them, that they may do them in the land which I give them to possess it.
Before God gave the Law to the people of Israel, He promised Adam and Abraham that He would send Christ, the eternal covenant. The law given through Moses, 430 years after God promised Abraham to send Christ, was only in effect until Christ came. And the law is leading everyone to believe in Christ by making them realize that they are sinners. (Genesis 3:15, Gal 3:16-19, 21-22)
Genesis 3:15 And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.
Gal 3:16 Now to Abraham and his seed were the promises made. He saith not, And to seeds, as of many; but as of one, And to thy seed, which is Christ. 17 And this I say, that the covenant, that was confirmed before of God in Christ, the law, which was four hundred and thirty years after, cannot disannul, that it should make the promise of none effect. 18 For if the inheritance be of the law, it is no more of promise: but God gave it to Abraham by promise. 19 Wherefore then serveth the law? It was added because of transgressions, till the seed should come to whom the promise was made; and it was ordained by angels in the hand of a mediator. 21 Is the law then against the promises of God? God forbid: for if there had been a law given which could have given life, verily righteousness should have been by the law. 22 But the scripture hath concluded all under sin, that the promise by faith of Jesus Christ might be given to them that believe.