We had this when dd1 was 4 and my dsis had a baby with a major chromosome disorder. Dd1 knew from the outset that the baby was not well he had a feeding tube in his nose, very obvious cataracts and some skeletal deformities and we just explained it to her in terms of some babies not growing properly while they were in their mummy's tummy and they weren't strong enough to grow into big children once they'd been born. We are Catholics, as it happens, but I don't think that really changes the approach you need to take.
To make things worse for dd1, this happened a few months after I'd had a non-developing pregnancy with subsequent treatment -- we'd already told dd1 she was going to have a brother or sister, and she was present at the scan where they told us out of the blue that the pregnancy wasn't viable, so she experienced it all a bit more closely than I would have liked.
I was concerned that dnephew's death would affect dd1 particularly badly after me losing the pregnancy, but tbh it wasn't as bad as we feared. She did ask questions about death for some while afterwards, and we did have phases of going over and over the facts with her. I think it helped to make a distinction between babies or children that are sick or don't grow properly, or old people who are very ill and tired on the one hand, and the rest of us on the other, so that they don't start assuming any of their family might die at any time. Clearly that's a slight fudge, but I think it's reasonable to keep reassuring them that most people don't die until they're very old, and that we had no plans to die ourselves, and that she wasn't sick so was unlikely to die herself.
hth -- it is an awful situation, but ime children that age really don't have the same overview as adults and can cope with upsetting things quite pragmatically, especially if it's not their immediate family that are affected. But keep your feelers out for those lingering questions.