My daughter was like this at 6. She was arguably worse. However she was an absolute angel at school. A friend with an ND daughter made me aware that there were lots of flags for neurodivergency, and that "bad behaviour" is just a child's way of communicating their needs aren't being met. I researched ND friendly parenting methods and switched up my approach which helped massively.
I also actively worked on identifying what needs were unmet. After my daughter was calm, we would discuss her "big feelings", and talk about what made her feelings "grow" like that. It may be controversial but I made sure she didn't feel as though I was shaming her for her behaviour, because I wanted her to open up to me, so I could find and address the root of the problem.
I also made sure my expectations were very clear and simple, and got DD a star chart to reinforce this. It really helped as DD is super competitive. I also made sure that consequences for rule breaking were clear and consistent, and tried to only use natural consequences that were related to DDs behaviour.
I also booked to go on the Triple P parenting course to learn new parenting strategies. But COVID put a stop to that.
For what it's worth DD is 10 now, she's been diagnosed with ADHD, moderate learning difficulties, and a mild language disorder. She's also on the ASD diagnosis waiting list. The root of all DDs behaviour was quite simply that she sees the world around her, and everything within it very differently to her peers.
DD rarely gets defiant anymore, and meltdowns are non existent. I genuinely think changing my parenting strategies has done far more than her diagnosis. It was hard work changing everything I did. But it's been so worth it