When my daughter was that age she started acting out twice. The first time was discipline related. Had to be fair and consistent and ensure she stayed with her routine. She’s 9 now and still she has to have that routine or she seems lost.
The second time she was doing it for my attention. I had been really busy at work and working extra hours. She was acting out because even bad attention was attention to her.