Just to add, while headlamps are pretty damn reliable these days, anything can fail - in fact my current model did while still less than a year old, faulty connection.
The previous one I had (Princeton Tec) lasted 15 years and in fact still works except the strap has turned into overstretched knicker elastic.
The failed one came from the USA but Princeton Tec UK replaced it FOC under the warranty.
The one I have now is fine.
So anyway, having also learned the hard way (think I already posted about rewiring battery contacts in the pitch black on a rock in the arse end of nowhere surrounded by many more rocks), I always have a back up now.
They’re very very rarely needed, but when you do need one, you’re very glad to have it!