I don’t think that we should hide death from children, as it is one of the natural parts of the great cycle of life. Children need to learn how to understand the world, how to think about what happens in it, good and bad, and how to express their own feelings in a healthy way. I don’t see why a child of 4-5 would be too young. They might not fully understand it at first, but before long, death on TV or in movies or books, death of a pet or perhaps a classmate or grandparent will be part of what they see, and I see no good reason not to start preparing them for that gradually.
Perhaps the urge to cover it up, even if it’s just a goldfish, stems from the impulse to try to keep them happy at all times. Or perhaps it is a result of your own discomfort with the topic. If the latter, I would recommend taking a little time to reflect upon your own (perhaps spiritual) beliefs and your emotions about the topic first, and then think about how to discuss the topic with your child the next time the topic does come up, whether as a floating goldfish, or a news story on TV, a character dying in a storybook, or just an innocent question out of the blue.
I would be perfectly honest about it. I would teach that death is just part of life, and that nothing lives forever. If you have spiritual beliefs about what happens afterwards, talk about them; if not, then perhaps a comparison to sleep would be non-religious yet non-threatening. If you want to bring it up out of the blue, start with the least threatening examples, like when plants die, or when leaves fall. If talking about a pet or a person, be honest. Talk about sadness. Talk about how the sadness fades, and you learn to accept it. Talk about how a loved one, perhaps a grandparent or parent of your own, lives on through your memories, through the love between you, and possibly through what they accomplished. Take them with you when you visit a gravesite of a loved one. Have them help you choose flowers, and place them there. I don’t see why an child would be too young to accompany you on such a visit. They’ll understand however much they understand, and it will be a healthy part of their experience as they grow up.
There are values related to life and death which I would want my child to learn, including the value of life, and respect for life; the fact of death, and respect for the dead and for the grieving; the fact that it’s healthy to be sad, and to express that sadness, and how expressing sadness helps us get over sadness; the importance of comforting those who grieve and remembering and honoring our departed loved ones. I think that the loss of a pet or a classmate is as good a time as any to start talking about and teaching those values.
But do try to become comfortable with the topic first, because if you’re uncomfortable, I’ll bet your child will pick up on it and become uncomfortable too.