These are the possible answers I have found when I studied in-depth the Gods word, there could be some other answers which I am unaware of. In this article I am trying to make an attempt to provide the best possible answer after my research.
1. Hell was divided into two areas: The first one The Abode of the Just - Abraham's Bosom (Lk 16:22-26) and the second one is Gehenna (Greek): This is the lake of fire. Eternal damnation (Mt: 18:9).Old Testament studies that a redeemer was coming to save them from their sins went to a place the Jews called Abraham’s bosom or Paradise. All people went to a place of conscious existence called Sheol. The wicked were there (Psalm 9:17; 31:17; 49:14; Isaiah 5:14), and so were the righteous (Genesis 37:35; Job 14:13; Psalm 6:5; 16:10; 88:3; Isaiah 38:10). The New Testament equivalent of Sheol is Hades. Prior to Christ’s resurrection, Luke 16:19-31 shows Hades to be divided into two realms: a place of comfort where Lazarus was and a place of torment where the rich man was. The word hell in verse 23 is not “Gehenna” (place of eternal torment) but “Hades” (place of the dead). Lazarus’s place of comfort is elsewhere called Paradise (Luke 23:43). Between these two districts of Hades is “a great gulf fixed” (Luke 16:26). The unsaved dead remain in torment till the end of the Millennium when they’re brought back to life for their final judgment. (Rev. 20:11-15).Also we know in apostle’s creed that Jesus died, He descended to the realm of the dead (hell in English, Sheol in Hebrew, Hades in Greek). He descended there as Saviour, proclaiming the Good News to the spirits imprisoned there (1 Peter 3:18-19). Paul prayed for Onesiphorous after he died, "may the Lord grant that he will find mercy from the lord on that day" (2nd Timothy 1:16-18). "After his death, Jesus went to preach to the Spirits in prison" (1 Pet 3:19)"Nothing unclean can enter heaven" (Rev 21:27)
2. Some people would have been saved by following the Law and by faith in God (Romans 3:28) until Jesus came in human flesh. Those who trusted in God's Law were saved as the Law speaks of Christ because they knew under the Law they needed God's mercy, those who truly trusted in the Law looked forward for the Savior but they never made a personal decision for Christ" during their life by accepting Jesus to be their personal Saviour because they never knew Christ in detail.
“In the past God spoke to our forefathers through the prophets at many times and in various ways, but in these last days he has spoken to us by his Son, whom he appointed heir of all things, and through whom he made the universe” (Hebrews 1:1-2). Our faith is in Jesus Christ, but their faith was in God. Faith that He would provide a Redeemer to take away their sins. Abraham had faith in the Lord, and the Lord accounted it to him for righteousness. Therefore, Abraham was saved. (Gen 15.6).David was saved by faith in God. (Ps 86.1-2). Isaiah was saved by faith in God. (Isa 61.10a) By faith, Abel, Enoch, Noah, Abraham, Sarah, Isaac, Jacob, Joseph, Moses, Rahab etc was saved and all are considered heroes of faith. They loved God with their whole heart and were fully committed to obedience. The Old Testament Prophets sought after God and were rewarded and the faithful souls pleased God ((Heb 11:6).
Noah, Abraham, Isaac,Jacob,Rehab the prostitute, Moses, Sarah, Gideon, Barak, Samson,Jephthah,David,Samuel and the prophets who through faith conquered kingdoms, administered justice, obtained, promised, shut the mouths of lions (Heb 11:7-12:1) . None of them knew Christ; none of them were "born again. It was their honest search for truth and faith in God that saved them.
Hebrews 11:13 states that all these people were still living by faith when they died. They did not receive the things promised; they only saw them and welcomed them from a distance. And they admitted that they were aliens and strangers on earth.
3. Jesus died for all: Jesus humbled himself and became obedient unto death, even the death of the cross” (Philippians 2:5-8). Jesus died For every man (Heb. 2:9),For the world (John 3:16),For the sins of the whole world (1 John 2:2),For the ungodly (Rom. 5:6),For false teachers (2 Peter 2:1),For many (Matthew 20:28),For Israel (John 11:50-51),For the Church (Eph. 5:25),For "me" (Gal. 2:20).
4. Jesus is called the first-born and was existed before all of creation: Romans 8:29; Colossians 1:15-18, Hebrews 1:6; 12:23; Revelation 1:5. These verses say about his preexistence. So Jesus existed before all of creation, since all things were created by Him. John 1:14 describes it this way; “The Word became flesh and made His dwelling among us. “Jesus was "made a little lower than the angels"; i.e., But Hebrews 2:7-9 explains that when Jesus became a man, He became a man. He was made lower than the angels in the sense that He took on human flesh.
5. Old Testament saints had faith in Messiah Jesus even before He was born and they believed God would provide a Redeemer to shed blood in atonement for their sins.
6. Animal sacrifices foreshadowed Christ’s sacrifice: God required animal sacrifices (Exodus 29:38-42) to provide temporary forgiveness of sins and to foreshadow the perfect and complete sacrifice of Jesus Christ (Leviticus 4:35, 5:10). Animal sacrifice is an important theme found throughout Scripture because “without the shedding of blood there is no forgiveness” (Hebrews 9:22). Animal sacrifices have ended because Jesus Christ was the ultimate and perfect sacrifice. John the Baptist recognized this when he saw Jesus coming to be baptized and said, “Look, the lamb of God who takes away the sin of the world!” (John 1:29).
7. Old Testament prophesies the coming of Jesus as the Messiah: Believers heard about the Messiah from their prophets who clearly described where He would be born, betrayed, died and resurrected. Jacob (Genesis 49,10), Moses (Deuteronomy 18,15) and David (Psalm 22) prophesied about his coming. John the Baptist prepared the way for our Lord by preaching about the one to come and a baptism of repentance. For as in Adam all die, so also in Christ all will be made alive. But each in his own order: Christ the first fruits, then those who are Christ's, at his coming. Then the end comes, when he will deliver up the Kingdom to God, even the Father; when he will have abolished all rule and all authority and power. For he must reign until he has put all his enemies under his feet." 1 Cor. 15:22-25
There are numerous verses which predicted the coming of Christ For Eg: Isaiah 7:14, Isaiah 9:6, Micah 5:2, Zechariah 9:9, Psalm 22:16–18, Isaiah 53:3–7, Zechariah 12:10 , Psalms 110:4 etc
8. Now what about the people who never heard Jesus Christ? Jesus excused His executioners (Luke 23:34), so also He excuses those who have not heard or do not understand the Gospel message. God does not care if you belong to any denomination but people still know God even if they have never heard the gospel. God once overlooked the ignorance of the Gentiles, but now demands repentance - Acts 17:30-31.God loves man, his creation, and does not desire "that any should perish, but that all should come to repentance." (2 Peter 3:9).God reveals Himself in creation( Psalm 19:1-4, Romans 1:20, Deu 4:29), through conscience( Rom 2:14-15), Through Jesus Christ, as Redeemer, Savior, Lord (Isaiah 43:11, John 1:1, 11-12, 14, 18),through scripture(I Timothy 3:16) through preaching and teaching the gospel( Acts 17:23). When a person who has never heard of Jesus obeys his conscience, God will get the truth of salvation to that individual, (John 6:45, 7:17). Biblical examples are the Ethiopian eunuch in Acts 8:26-40, Saul in Acts 9 and Cornelius in Acts 10. God makes it clear in Rom 2:14-15 that conscience conveys God’s law to human hearts even when they haven’t heard, even when they don’t have a Bible. Because no one has been kept in the dark about God, we’re all accountable to Him (Luke 12:47-48). If a person, from creation and conscience, seeks to know more about God, God will reveal Himself to that person. (Acts 17:26, 27).
Abimelech is an example of this in Genesis 20:1-12, before any books of scripture had been written. Abimelech had the law of God written on his heart and God also spoke to him in a dream. The gentiles or unbeliever is able to know and keep some of the moral law because they are made in the image of God.
Conclusion: Our aim should be to preach the Gospel to every creature to give the knowledge of salvation to tell the truth about our Lord Jesus Christ.