The OT saints were saved the same way the New Testament saints were/are saved–by faith.

Romans 4:3-8(KJV)
3 For what saith the scripture? Abraham believed God, and it was counted unto him for righteousness.
4 Now to him that worketh is the reward not reckoned of grace, but of debt.
5 But to him that worketh not, but believeth on him that justifieth the ungodly, his faith is counted for righteousness.
6 Even as David also describeth the blessedness of the man, unto whom God imputeth righteousness without works,
7 Saying, Blessed are they whose iniquities are forgiven, and whose sins are covered.
8 Blessed is the man to whom the Lord will not impute sin.

As you can see, the Bible tells us that Abraham was justified by faith (see Rom. 5:1 and Eph. 2:8-9). That is, his faith is reckoned as righteousness, v. 4 above. They were saved by faith in the Messiah in whom they were trusting. Only, for them it was a trust in the future Messiah. They knew He was coming as had been prophesied.

Also, the Holy Spirit was there in the OT times the same as the NT times. Consider Psalm 51:11, “Do not cast me away from Thy presence, And do not take Thy Holy Spirit from me.”

God did not change how He saved people in the New Testament. It has always been by faith. In the case of the OT people, they looked ahead in time to the Messiah. We look back to Him and see the cross.

Salvation in the Old Testament – by Faith or by Works?
by Rich Deem

Being right with God

So how do you become righteous enough to be acceptable in the eyes of God? Much of the world has decided that one can become acceptable to God if the good deeds outweigh the bad deeds. The problem is that this concept is never stated in the Old Testament. The Hebrew word, yeshuah (Strong’s number H3444), or one of its derivatives, usually translated “salvation,” nearly always refers to a work of God. In fact, in 104 out of 106 instances “salvation” refers specifically to a work of God that has nothing to do with any human effort. A verse from the Psalms specifically ties salvation to belief:

Because they did not believe in God, And did not trust in His salvation. (Psalm 78:22)

Another verse indicates quite clearly that humans are unable to intercede on their own behalf because of our lack of righteousness:

And He saw that there was no man, And was astonished that there was no one to intercede; Then His own arm brought salvation to Him; And His righteousness upheld Him. (Isaiah 59:16)

Examples of faith
Examples of people being justified by faith abound in the Old Testament. Abel, by faith brought the best of his flock as an offering, while his brother Cain brought an offering that was not good. Enoch, by faith, walked with God, and so was taken by God to heaven. By faith, Noah built an ark hundreds of miles from the ocean.Abraham, by faith, left the land of his birth and went to the land of Canaan as God directed him. Genesis tells us that God counted Abraham’s faith as righteousness. Later, Abraham offered Issac, His only rightful heir, as a sacrifice to God. Although God stopped Abraham from completing the sacrifice, he would have done so by faith in what God had told him to do.

Examples of faith and disbelief abound in the Exodus story. First, Moses’ mother had faith in leaving the helpless baby Moses to be discovered by the very people who intended to kill him. Later, the people believed God in the midst of the Egyptians and put blood of a lamb on their doorposts as a sign of faith for the Lord to spare the first born of their household. By faith, Moses lifted his hands as the Lord directed to part the Red Sea so that the Sons of Israel could escape the Egyptians.

By faith, the Sons of Israel looked upon a bronze serpent to protect them from snakebites in the wilderness. By faith, Rahab, the harlot, believed the spies of Israel and helped them, trusting in their God. Because of this, she was saved from destruction when the city of Jericho was conquered by the sons of Israel. By faith, the Sons of Israel marched around the city of Jericho for seven days and the walls fell down.By faith, Gideon let God reduce his army from 32,000 to 10,000 to 300 men to conquer Midian.

Besides the many example of faith in the Old Testament, there are many Old Testament verses that promote and encourage belief in God and His promises. Other verses criticize lack of faith and disbelief. Habakkuk says that “the righteous will live by his faith”Although many Orthodox Jews believe that they will be justified by obedience to the law, God specifically says that He chose the Jews because of His promises and not because of the righteousness of those people. There are many other verses that indicate that all people have sinned and rebelled against God. Salvation must, therefore, be based upon something other than faithfulness to the law.

Conclusion

The law of God is good and does not represent just suggestions for righteous living. However, no person (other than Jesus Christ) has ever kept the entire law. Because of these failures on our part, God has provided a means by which we can be declared faultless under the law. Jesus paid the penalty for sin such that His righteousness is imputed to us through faith in Him. It’s a great deal. He takes our sin and gives us His righteousness through faith. God’s terms for salvation have not changed from Old Testament to New Testament. Those who died before Jesus walked the earth are justified through faith in God’s provision of the then coming Messiah. Those who came after Jesus are justified by faith in the efficacy of His sacrifice for sin.