Have you heard of drop the rope?
Sometimes when we find ourselves in a battle state with children, where they react to something we do or say, it can make us feel that we must pull back lest they "win". And this can result in a totally unproductive back and forth tug of war that never really gets anywhere.
If you're the kind of person that can just stay calm, hold fast and weather the storm (my DH is) then that's fine, but if you can't help but pull back... try dropping the rope. You do not need to have a power struggle with a child, because you are the adult, you do hold all the power, you don't need to prove it by yanking back and forth. Don't engage in an argument, don't take things personally, recognise that child is saying whatever they know will upset you, rather than what they actually mean, so just walk away and talk to them when they are calmer.
(If this is totally and utterly unclear, as it may well be, I need to go to bed, try googling "Drop the rope parenting")
I have also found the book When Your Kids Push Your Buttons to be helpful.
And the approach in Ross Greene's book Raising Human Beings.
Lastly I found it quite helpful to view parenthood as a series of transitions. When they are very little, under about 7, you decide all the rules but you also mostly control the environment, so that the child is not responsible for upholding those rules, because they aren't capable yet. So you don't let your newly-walking one year old toddle around next to roads, you don't let your 3yo have access to sharp knives, you don't offer your 6yo unlimited unfiltered internet.
In the middle stage, roughly 7-14, you're still mostly in charge of the rules but you've loosened the control on what they can do - so they are in charge of whether they follow them or not. You let them get things wrong and discover the consequences. This is a process, not an overnight switch. You wouldn't give a 10yo a credit card, but you might let them get into trouble for not doing their homework.
Into the teens, there's another shift again - they are starting to decide rules for themselves and you step back and act as a sounding board or guide, but mostly just there as a safety net. Because they are learning to work out their own rules, it's helpful if you step back from making too many rules or trying to control too many things. There will still be certain areas where it is necessary, but others where it isn't.