Realize if(0) condition in analog circuit ?
Use a comparator, with the positive comparator pin voltage adjusted just above 0 Volts, with a simple resistor voltage divider. Then, connect negative comparator pin to your square wave. With this configuration, your comparator will output 1 when the square wave input is 0. Then connect your comparator output to a BJT transistor's base,  biased in saturation mode, or to a relay. This way, the BJT will switch on when square wave input is 0.