Electric circuit which flips voltage
Figure 1. A basic comparator circuit. Source: All About Circuits.
A comparator's output switches output state depending on the relative voltages at the input. In the case of Figure 1 it has been configured to switch high when VIN exceeds VREF. For your case you would swap the two inputs to get the inverse action.

For instance if the input is Vi &gt; 0 V then the output will be 0 V and if the input is 0 V then the output is &gt; 0 V.

You will have to assign some tolerance to your definition of 0 V. e.g., VIN ≤ 100 mV or similar. You then set VREF to that value and the comparator will work.