Pressing a light flips it and its four neighbours. Turn every light off. Each puzzle is generated so it is always solvable, and the game works out the minimum number of moves so you know exactly how good your solve was.