DH took DD to the Church the evening of her DGGF's removal (the night before) while I had been to the house beforehand with the open coffin (and went on to the church). She went to school and afterschool club as normal the day of the funeral and we collected her a little early. She was 4. (She had also been in the house the evening DGGF had actually died, the evening before the coffin "came home", as I called and cooked dinner for DGGM and my DAunts and DUncles - knowing none of them had thought about food - DD referred to the particular meal I made that night as "Grandad's Dinner" for a good couple of years, which was interesting explaining if people asked!
Especially as it was one we liked to eat a fair bit.)
When she was 7, both her DGGM's died within 8 months of each other. For the first, for logistical reasons (house across the city from us), we had to take her to the house with the open coffin but had talked to her lots beforehand and didn't make her go into that room - she stayed with DH while I went in. She also came to the church that evening. But the following day, she went to the crèche for her normal afterschool club (logistically worked out as the summer camp she was doing was mornings only, and crèche were happy to help, she joined a trip to a sports centre) while DH and I went to the funeral.
The second was again during school term and DH was abroad for work, so again DD came with me to the house with open coffin but had the choice. There were DCousins her own age there, which helped and they were going in to see DGGM comfortably so DD went into the room but not near the coffin (again, lots of talk beforehand and whatever she wanted). She also came to the church that night. But again she went to school the following day, as she didn't want to go to the funeral and I wasn't up to wrangling with her on my own and trying to manage my own feelings.
DD knew all 3 very well, as we had spent a lot of time with them over the years.
I found the Winstons Wish website very helpful, both in the run up to the 3 deaths and the aftermath. And again when DFIL was ill and died a few years later. How to explain things to DCs, and how to give them options, and what to think about as adults. And other things they can do to remember the deceased in their own ways. (And how to not get upset when DCs are very practical and bounce back quickly from upset).