Many often wonder how people were saved in the Old Testament. Some mistakenly conclude that if the Jews simply observed the Law and if they kept the rules well enough that God would save them in the end. However, that is not the case. It’s always been by grace alone. Professor Max Turner (who is a former professor of mine at London School of Theology and is still a friend to this day) helpfully wrote in one of his footnotes 5 sentences speaking to this that you may find helpful.
"Jews were not (as once thought) ‘legalists’, who believed in the need to keep every item of the law perfectly, in order to achieve salvation. Essentially most believed God had chosen them them and destined them for eternal life by grace, and that a Jew would only be barred from the new creation if he or she deliberately revoked the covenant (e.g., by gross unrepented sin). Otherwise repentance, the sacrificial system, the day of atonement, etc. were all there as testimony to God's mercy towards the sinner, and as the divinely appointed means of receiving forgiveness. Jews thus kept the law as a thankful response to God's grace and calling (not in order to earn a place in the redeemed order). This pattern of belief has been called ‘nomism’ (in deliberate contrast to ‘legalism’).”
- Max Turner, The Holy Spirit and Spiritual Gifts, 51-52, note 47.