I had a policy that if difficult child messed up, he must be honest from the onset. If he lied about something, his consequences would be much more severe. I worked hard to not "flip out" when he'd mess up. Escalating because my frustration, loss of patience, anger etc always made a situation worse.
I tried to make logical consequences. I tried to allow schools natural consequences be the result of school problems. I backed the schools consequence. I would only implement further consequences for severe infractions if he was already disciplined at school.
I worked hard to figure out what worked best to get difficult child to respond to parenting. For my difficult child, it was not treating him like a child. Even if he behaved and thought like one. He was the type that wanted to believe he could be nearly equal, so spoken to with respect and not condescended to. It was what helped him accept more readily when things didn't go his way. It also allowed us to communicate much easier as time went by and he grew older. He is comfortable discussing something. he isn't comfortable feeling preached at by his elders. Doesn't work for every kid, but was a deal breaker if not done with difficult child.
I always told him, and always followed through, that if I felt he was wronged, i was on his side. That if he was in the wrong, I was there for him to help move past it, but that I wasn't making excuses for him nor would I accept excuses from him. He learned early on that it was the way it would be, I didn't waiver. Therefore, he comes to me now if he feels he is being given short end of the stick. Instead of raging at a teacher or something, he'll come home to vent to me, explain it, knows I'm hearing and listening to him, and will work with him to find a solution that doesn't involve previous patterns he had such as cursing at teachers, throwing chairs in the class room, etc.
I learned to prioritize certain things. If his behaviours were out of control, getting on his case to clean his pigsty bedroom would escalate into a full blown meltdown. So bedroom mess was in a lower priority basket. I worked at accomplishing a extended period of time without a meltdown. I'd give him opportunities to accomplish things successfully that I knew he would want to do. Always thanking him and praising where needed. Then I'd move into the bedroom cleaning etc. I think it was key for me as a parent, to realize that I didn't need to fix each of his problem areas all at once. Not if some things were seriouslly wrong, like voilent outbursts etc.