I'm so sorry for your loss. I had my last mc when dd was 4 and she was around whilst I went to hospital and saw doctors. So she knew something was going on.
I told her, before I knew about the mc that either mummy was going to have a baby, or I was just going to be poorly. I had a history of recurrent mc so thought it best to cover my bets.
DD has always known that mummy's good at lots of things, but not at having babies. I explained that I had tried to have babies before she came along but they didn't grow properly, so mummy lost them.
Being 4 she just accepted this. Now she's 7 she occasionally asks questions about the babies I lost, but she just seems comforted by the fact that she wasn't lost...and that I love her soooo much.
I told dd that mummy might be a little bit sad in the next few weeks, because I had really wanted her to have a brother or sister, but that I know how lucky I am to have her. That prepared her for the bad days to come and reassured her, I think.
Years later she knows....mummy's rubbish at having babies, but that's ok. because she didn't want to share her things anyway!
Kids are resillient, but they will pick up on vibes in the house and if you're not honest about what's happened, they'll think they're to blame.
Good luck with dealing with this. I know you're having a crappy time right now, but things do get better...and sometimes worse, then better. I wish you strength for yourself and rely on the love of your family and you won't go far wrong. Take care...