“Although a sinner does evil a hundred times and may prolong his life, still I know that it will be well for those who fear God, who fear Him openly. 13 But it will not be well for the wicked man, and he will not prolong his days like a shadow, because he does not fear God openly.” (Eccl. 8:12 LSB) https://accordance.bible/link/read/LSB#Eccl._8:12
Jesus, God as man, said these same words a bit differently when He said if anyone is ashamed of Me in this evil and adulterous generation the Son of Man will be ashamed of him when He comes in His Father’s glory with His holy angels (Mk8.38). There are two types of people who identify as Christians. Those who are basically moral, at least in the pagan or worldly sense of the word, and those who seek God and seek to make God known in the world. The first tries to be good as he defines good assuming his goodness will get him into heaven. The second seeks God Who is good and works to spread His goodness to the world. It is the second who can know for sure that he will live forever with God in the kingdom of God among all those who have loved God openly on earth as well. These are received by God not because of their works but because of their love for God and their faith in His work accomplished for them. God calls His people His ambassadors, His witnesses, His priests. God has mandated the church as His marketing department for making Him known, felt, and seen in the world. Those who are openly in love with God and actively engaged in helping others love God will receive God’s eternal reward but those who remain silent about God, who only identify with the people of God in the safety of the church but are not active in building His church, these have no reason to believe they will be received by God for their shame of Him creates a barrier before Him.