A very simple approach, is shown in the following schematic.
The 2 resistors of 1 kOhm each, make a voltage divider /2, providing a Vcc/2 voltage to the (+) pin of the comparator. This is used to set the (+) input at higher voltage vs the (-) input -and so- force the output (Y) to high state (Vcc).
When voltage at pin (-) of comparator goes more than Vcc/2, then the output of the comparator (Y) goes at low state (GND) and vice versa. If you ommit the resistors, the input voltage at pin (-) must be > Vcc to trigger the output.
Try it!
View attachment 35073