Good question. Behavioral psychology tells us that children start to comprehend complex and the cognitive reality of life and not-life or death about 24 months. They are able to conceptualize that objects, things even if not in their physical presence has existence when not in their line of sight. Matters such as love, attachment, grief, mourning, more adult ways of dealing with death and loss are really not present until 4 or 5.
I have never been a big fan of open casket type of funerals/memorials with very young children because of the confusion and misunderstandings of how they process life and death. “Why is grandma/grandpa in the box?’ and why don’t they get up and play with me?” This can cause confusion for young children. It is not a natural place they would expect to see grandma, at least for them. And remember with young children they lack the adult capacity for words and self-expression to tell others what they think and feel. So if you decide to take a young child to a funeral service they should be of the age where they can understand and process why grandma is not “waking up” and how she is not with us here on this earth, but with Jesus and she still loves us. That’s a tall order for little people. And not all children develop emotionally or spiritually on the same path or time-line. Each child, each family situation is unique.
I have found the best outcomes that for little children happen when they are made part of the end of life process for older relatives in their lives. They visit and see grandma/grandpa in a hospice or home when they see the life process and death as a natural progression on the nature of life. From a faith matter, they need to be told when able that physical death in not the end. We will see, they will see grandma and grandpa again, heaven is indeed for real. And the Good Lord awaits us all.