But before faith came, we were kept under the law, shut up unto the faith which should afterwards be revealed.
Note 8 at Ga 3:23: "But before faith came" is not referring to faith in general, which Abraham exercised 430 years before the Law. This is the faith described in Ga 3:22--the "faith of Jesus Christ." People have always been saved by faith, but the content of their faith has varied. Ga 3:25 reveals that faith has come; i.e., the understanding of faith in the Lord Jesus Christ for salvation.
Note 9 at Ga 3:23: "We were kept under the law, shut up" waiting for saving faith in Christ to be revealed. The word "kept" in the Greek carries the idea of the Law being a jailer who has imprisoned us under guilt and condemnation. We are always aware of the consciousness of sin and always looking inward at ourselves. Faith in Jesus Christ is the only key that unlocks the door to the Law's harsh imprisonment of guilt and condemnation (1Co 15:56-57).
The Law acted as a barrier that prevented us from ever obtaining salvation through our own efforts. The Law's standards were so high that we could never scale them. We were "shut up" so that the only way we could look was up to God for help.