At 7, I took my explosive child to the GP, and by his 9th birthday he had diagnoses of dyslexia, dyspraxia and ASD. We get phases of moods, and there is a termly cycle. He's under the weather at the moment and had a humdinger of a blowout this evening. His normally sunny and placid sibling hasn't been vastly better either and neither has protested about an unusually early night!
Access to tech gives me greatest leverage. The default is a morning and evening tech allowence. Morning has to be earned by surviving the potential flashpoint of getting dressed, including critically, the dreaded socks. Tech is reduced for poor behaviour and increases can be awarded for helpful chores.
General grumpiness tends to result in chill out time in his room. It's phrased as his safe space/ quiet time rather than time out. I will talk to him when he's ready (there's no point before that!) Sometimes he'll just want my quiet presence if he's just tired and grouchy.
He needs quiet time after a day of battling, coping and masking through school. He struggles with any extension to the school day, but can handle out of school clubs after a buffer of quiet, food and drink. Hunger is a big trigger too. He needs warnings about transitions.
7 is an age when flashpoints often show up. With DS1, the extra jump of work and booster sessions building to SATS showed that up! DS2 seems to be feeling tiredness more than last year too even though his routines haven't changed.