A light unit rarely fails all at once. Instead, it tends to grow gradually dimmer over weeks or months, which makes the change surprisingly easy to miss if you're cycling the same route every day and simply growing used to how it looks.
The clearest way to judge this is to compare the light against how it looked when it was new, ideally in similarly dim conditions. A beam that once lit the road clearly ahead can end up offering only a faint glow, without ever announcing the change directly to the rider.
Test it properly, not just briefly
Switching the light on for a few seconds indoors rarely tells the full story, since most units appear reasonably bright in a dark room regardless of their actual output. A short test ride at dusk gives a far more honest impression of how well the light is actually performing on the road itself.
If the unit runs on replaceable batteries, it's worth checking the contacts for any slight corrosion, which can weaken the connection long before the batteries themselves are properly spent. A quick wipe with a dry cloth sometimes restores brightness that seemed lost for good.
For rechargeable units, keeping track of roughly how long a single charge tends to last helps you notice when that duration starts shrinking. A steadily shortening battery life is often the clearest early warning that the unit itself is beginning to wear out.
Once a light is clearly past its best, replacing it sooner rather than later makes every evening ride considerably safer. Waiting until it fails completely only leaves you without any light at exactly the wrong moment.