Hebrews 11:39-40 says:
"And all these, having gained approval through their faith, did not receive what was promised, because God had provided something better for us, so that apart from us they would not be made perfect."
Let's look at this in context.
Previous verses in Hebrews 11 describe many Old Testament saints who had faith in God. Through their faith in God, they accomplished amazing deeds such as parting the Red Sea, conquering kingdoms, shutting the mouth of lions, quenching the power of fire, resurrecting the dead, and many acts of righteousness (vs. 29-35). Through their faith, some also underwent persecutions, imprisonment, torture, and death, believing they will obtain a better resurrection (vs. 35-38).
However, the Bible tells us that although they obtained approval (eternal life) through their faith in God, they did not receive what was promised.
What was promised? What did they not receive apart from us?
What was promised was perfect righteousness. But their deeds did not make them perfect.
Jesus said, "I am the way, and the truth, and the life; no one comes to the Father but through Me." (John 14:6)
It wasn't until Jesus' atoning death on the cross that perfection came. Jesus died for us and paid for all our sins. He paid for people of the past (including Old Testament saints), present, and future. We take on Jesus' righteousness when we believe in Him by faith. The Old Testament saints needed to believe in Jesus too.
That is, the gospel had to be explained to them in order that they have the righteousness of Jesus upon themselves. By their works they would not be perfect (because everyone has sinned and good deeds cannot cancel out any sins). So everyone needs Jesus to be made righteous.
But who explained the gospel to the Old Testament saints?
Hebrews 12:1 implies that the early Christians and apostles did.
"Therefore, since we have so great a cloud of witnesses surrounding us, let us also lay aside every encumbrance and the sin which so easily entangles us, and let us run with endurance the race that is set before us, fixing our eyes on Jesus, the author and perfecter of faith, who for the joy set before Him endured the cross, despising the shame, and has sat down at the right hand of the throne of God." (Hebrews 12:1)
Perikeimenon (περίκείμενον) is the Greek word used here, which means "lying around us" or "surrounding us." The phrase perikeimenon hēmin nephos ("a cloud lying around us") evokes an imagery of a stadium where spectators surround athletes. This phrase suggests that the saints in heaven are actively present and attentive to what's going on on earth, rather than being distant or inactive.
So not only did Old Testament saints set an example before New Testament believers, they also saw and heard the gospel through the first Christians.
It seems that Old Testament saints gained approval (were taken to heaven) before Jesus came to earth due to their faith in God. (This is like a credit system where faith is like a credit card that gets them the goods [heaven] and Jesus paid for it later with His blood.) [See also how Moses and Elijah appeared in glory before Jesus died (Luke 9:30-31) supporting the concept of something like a credit system.]
As Old Testament scripture tells us: "But the righteous will live by his faith." (Habakkuk 2:4)
So even though Old Testament saints were in heaven, they were not made truly perfect until Jesus died for them and they understood the gospel.
They understood the gospel by witnessing what happened to Jesus and hearing what the apostles and early Christians were teaching.
Hence, they were a cloud of witnesses who saw and understood things as they unfolded. And they were not made perfect until the New Testament teaching was explained.
So in this sense, "apart from us they would not be made perfect" (Hebrews 11:40).
It is interesting how God does things this way. Instead of having a class in heaven teaching these things, God simply directed the saints to watch and be witnesses. This causes them to be involved in our lives, and what we do also enrich their lives, while Jesus begins the work of faith in all of us and perfects the faith of all of us.