When we say the Creed at Mass every week, there’s the line about ‘He (Jesus) descended to the dead’. We believe that at this time he redeemed the souls of those righteous and holy people who died before his time.
We can be reasonably sure of some of the OT people. The prophet Elijah, for example, was taken into glory by God himself, so we know he’s a saint in heaven now. Indeed the Carmelite order and many of the Orthodox have a great devotion to him.
Abraham is another - Christ himself, in the story of the rich man and the beggar, describes Abraham as being in whatever place righteous souls went to before Christ redeemed them.
King David is less certain, but very likely in heaven.
And I’m sure no sincere prayer is ever wasted. Even if you request the intercession of someone who isn’t in a position to help you, I’m sure help comes anyway, even if it’s not from the person you prayed to.