I'm so sorry you're having to go through this.
I had to deal with the same situation just before Christmas when my own wonderful Mum passed away. My little ones are 6,4 and 2 so varying degrees of understanding.
It was very sudden for us so it seemed every few days I was giving them new information. She had been unwell for a couple of months but nothing we thought that couldn't be fixed. Then she was diagnosed and left us just 12 days later.
When she was unwell I told them the Drs were looking at what was wrong and trying to fix it. A few days later when it was looking like it might be something more untoward but not yet confirmed, I said we didn't think the Drs would be able to make Grandma better but that they were looking after her and making sure she wasn't hurting.
Then she was diagnosed with cancer in multiple places, I told them what it was and that she wouldn't get better from this. My eldest asked the direct question of would she die and I was honest and said yes. These conversations were the hardest ones I've ever had but they felt better because they knew what was happening. It all happened so quickly we couldn't hide anything from them and I wouldn't have wanted to, provided we could do everything in an age appropriate way.
My eldest is very logical and so he needed to know all about cancer, what it is, how it grows in the body. Everything. It was hard explaining it all but he needed that. My 4 year old accepted she had gone and that she was in heaven (his words) much more easily than I thought he would.
So I would say prepare your DC as much as you can. It is never an easy path and they won't be easy conversations but I'm sending strength and sympathy for you and your family 