If you are only allowed to press a button 0 or 1 times, it doesn't really change the puzzle. If your solution involved hitting a button n times, and n is even, then just hit it 0 times. If n is odd, hit it once.

The order that you hit the buttons doesn't matter.

This seems to be a variation of the Light's Out puzzles. Light's Out was an electronic toy that was sold by Tiger Electronics, starting in 1995. There have been lots of variations made.

In the original Light's Out game, hitting one button changed the light for it, and for the 4 buttons it touched, but not the 4 diagonal buttons. So, the variation you have is slightly different, but the way to come up with a generalized solution for it is the same.

Coming up with a generalized solution is not easy, unless you are very familiar with linear algebra. Rather than try to explain it, I'll just link this page:

https://www.jaapsch.net/puzzles/lomath.htm
There is a lot to read there, especially if you follow the references that he gives. Hopefully something in there helps!