Click on Fill to turn on all the lights, then click on individual lights in the attempt to turn them all off. Clicking on a light toggles that light as well as its neighbors. Alternatively, you can click on Clear to turn off all the lights and then attempt to turn them all on.
If you want to start with a non-standard initial state of the lights, click on Fill or Clear and then right click on individual lights to switch those lights without affecting their neighbors. Then procede as above and attempt to turn all the lights on or off.
For some dimensions and some initial states, the puzzle cannot be solved. However it can always be solved from the standard initial state wherein all the lights are on, regardless of the dimensions.