If your light is powered by two batteries, simply flip one of them backwards during the day.

Otherwise, look for a headlamp that has a lock-out feature.

I use the Black Diamond Ion headlamp.
Older models have two metal touch sensitive contacts that allow you to turn on a red or white LED based on which way you swipe across them.
Newer models have a single push button.
Both models include the ability to place the headlamp in "lock" mode to prevent accidental activation.

I've wondered why more people don't use the Ion. It weights less than 2oz (with batteries) and a set of lithium lasts me a full season or more of casual use around camp.
In a pinch, it can be used for night-hiking (but with only two AAA batteries, this isn't what it was designed for).