I am sorry you are both struggling. If you can find a place that does collaborative problem solving for child or family therapy, i highly recommend it. We did it with my 7 year old daughter (unrelated to infidelity, although ironically just after dday, due to an almost year long wait list) and it was amazing for her and for our family. If not, maybe read up on it?
The basic premise is that children do well of they can, and it looks at identifying strengths, supports and barriers for both the child and the family(ies), and then working together to find better methods of handling target goals.
We had an 8 week session and it improved so much. For us, it involved teaching her to recognize black and white thinking and then find the more accurate thought, plus code words to tell her we understood and supported her but couldnt talk until she was calm. We also identified specific ways she could seek calm when upset at home, including spaces to be alone, yoga, and meditation (which she leads, by describing foods we pretend eat on a picnic: looks, flavour, smell, etc.)
I combined that with firm rules about respect for family members. Then we ALL worked on these changes. This was key. She called everyone out on black and white thinking, etc. 🤣🤣🤣 So expect that you will need to model yourself and be a part of the process. None of us is perfect either, and sometimes it is easier to learn techniques noticing other people's mistakes 🤣 . i went with it and acknowledged my own, and soon she was able to recognize it in herself without me pointing it out.
With your daughter, i would deemphasize how her words effect you right now, because she probably needs a safe place to explore her feelings. You can request it be done respectfully, but be careful not to shut it down either. One thing my WS struggles with, and one of his major whys so far is his inability to cope with negative emotions, which is a result of childhood issues. You and i want to do better by our kids than the things that lead down those kinds of paths, and i believe that involves learning how to be upset productively. So engage her in some distracting play and encourage her to discuss how she feels with everything going on. Ask what she knows about it, and what she wonders. Give her kid appropriate answers to her wonders, worries and fears, but its also ok and good for her to know you dont have all the answers and have your own sad feelings, worries, and fears. My kids knew we may be separating and why (as a BS, i took the lead in the messaging there, your BH may prefer the same privilege) and we talked a lot about what that would mean for them and also how it made mommy and daddy sad too. Sometimes their worries have easy fixes, but many dont. Its ok to acknowledge that and to be sad together about it.
So, next time, maybe ask why her life/day is ruined. If she gives some random answer, like you denied her cookies, i would say that she is allowed to be upset about that, but that you deserve to be spoken to with respect. Then follow up with something to encourage her to add more if she needs, like, "i want your life/day not to be ruined. The best way for moms to do that is for kids to tell us if something is bothering them. We cant fix things if we dont know what is wrong. So if something is bothering you, i would like you to tell me. Then we can try to fix it together" and see what happens. Or if she says she doesnt like it there, ask what she doesnt like, and ask what would make her like it more. Some things you cant do, but some may be simple and may bhlp her feel more secure there and with all these changes.
This is long, and i dont know if its helpful, but i am going to stop here. Good luck. Know you arent horrible for having a 5 year old say 5 year old things. But also know you can use this opportunity to teach her skills that will help her later. Good luck, it isnt easy.