Your question is one most Christians think about at some stage. I thought about it for a while in ‘normal everyday life’ and then more intensely when our child died before being born.
This question shouldn’t just force us to ask whether our child trusts God but also whether we do. I say this because, in his perfect wisdom, God’s decided not to tell us exactly what happens to our little ones who die. Our temptation then is to try and fill in the space left by God’s silence. The idea of an ‘age of knowing’ is very appealing but the Bible never discusses it. God simply hasn’t said what he will do with every child that dies.
God has told us about his character though. In the Bible he shows us that he’s always just and fair. He hates injustice. He also shows us that he’s always loving. In fact, he loves our children far more than we do and knows them better than we ever will. None of this definitely means that our children will go to Heaven. But it does mean that God won’t make the wrong decision. His decision will be good and loving and fair. We need to trust that he will do what’s right even when we don’t know what he will do or why he will do it.
But there’s still more to be said. The Bible says that the human race is in rebellion against God. The only way any of us can go to heaven is if he forgives us. He forgives us when we turn back to him and trust, or have faith in, Jesus as our king; the one who’s paid the penalty we deserve for our rebellion. But the Bible is also clear that it’s God who works in people to make them trust. He can do that to anyone at any age.
So what about children? There’s a general expectation in the Bible that the children of parents who trust or believe in Jesus start out life as believers. That’s why Paul instructs children as though they’re Christians (Ephesians 6:1; Colossians 3:20). In other words, generally, children start from the same position as their parents. That gives me a general confidence that one day I’ll meet my child in Heaven. Nevertheless, if Jesus makes a different decision to the one I hope for, it’s because he has a very good reason for doing so.
There’s so much more that could be said. Feel free to post another question so things can be clarified. I’m very aware that you could at this moment be watching your child die. I pray that God will comfort you in whatever your circumstances and that he’ll save your son. I also pray that you’ll know God. God the Father knows what it is to have a Son die and God the Son knows what it is to die. He’s not immune to your pain. He’s trustworthy and faithful and good.