Because God is perfect it is important to remember two things. One is that everyone will face personal judgment by God when they depart this life, and this is true if people believe in God or not. God does not come into being and is not controlled in his actions by whether someone believes in him or not. They get a crash course that God exists when they die and face the results of their life on earth. The second thing to remember is that God, being perfect, is the perfect judge. You don't need to worry that the just will receive their reward, and the unjust will receive severe punishment. Everyone from preborn infant to the oldest living humans receives perfect justice when they die.
One of three things happens. The just go to heaven, although even the best of people experience a purification before entering heaven. This is to "slough" away any vestige of sin because nothing can exist in heaven except that which can bear being in the presence of perfect light and goodness, which is God. Think of it as scabs that must fall off even the best persons who lived since it is inevitable that even they have wounds from sin. The less than just but still goodly people, who may be severely flawed but are still redeemable, spend a longer time in this purification, which Catholics call "purgatory." These people have souls that remained predisposed toward goodness and belief, even if many behaviors in their life was less than virtuous. This can be thought of as a pruning of a tree or a bush. Some types of bushes need to be severely pruned, almost cutting them to the ground so that they can live through the new growth after shedding the old. In the most severe cases the soul emerges much as they were as a baby, and they live as the infants do in heaven. What this means is that their relationships and experiences on earth do not translate into their heavenly individuality. So they would not retain any of their earthly experience or relationships in heaven, including when the body is resurrected again in the New Kingdom to come. So people who "escape" from being judged to hell by the skin of their teeth are purified in purgatory to an infant soul state. The third category of people, the wicked and the willful unbelievers go to hell immediately upon their passing. Hell is the place of permanent torment because it is the place where God's presence is totally withdrawn. People tend to think of hell as the place where the most violent people, especially men, tend to go. While this is true there are a distressing number of women in hell. There are more forms of violence than just the stereotype rampaging man with a gun or a military dictator. There are many women in hell and their noses do not stick so proudly up in the air there in hell as they did when alive on earth.
Prayers for your loved ones (and for strangers or groups of people who need prayers) do work, even if the person has already died. That is because God is not bounded by time or space. God can and does provide a "feedback loop" of your prayers now back "in time" to when the people were alive, and they might have tipped the difference for the subjects of your prayer, whether that was observable in their visible behavior or not. Only God can see the soul. People you'd never believe could be saved are saved by God every day. And, of course you must recognize that people you think are "ethical" or "generous" may not have such wonderful souls, and they find themselves in perdition.