Galatians 3:23. “But before faith came, we were kept under the law, shut up unto the faith which should afterwards be revealed.”
Before the Law was fulfilled, in the Person of Jesus Christ, we were held in custody under the Law, waiting for that Faith to come which would free us from the Law and give us the freedom of faith in Christ. The Law was put in place to protect, to instruct, to get us ready for the greater Grace that would come.
The Old Testament saints lived, under the law, with the hope and expectation of the coming of Messiah, Who would fulfill that Law. The Law was not considered a burden by the faithful. It’s ceremonies and rituals were a constant, comforting reminder that Messiah was coming.