I was as skeptical as you are right now when I first read the claims that wearing orange safety glasses at night might help my insomnia. To my surprise, I’ve found them to be quite effective.
The basic idea is this: you get tired when your body (the pineal gland, specifically) releases melatonin into your bloodstream. This is inhibited as long as the eyes keep sending the signal that there is blue light reaching the retina. Why blue light? It’s the color of the sky, during the day. Turns out candle light and firelight contain very little in the way of light in the blue range of the spectrum. Seems we’ve evolved to adjust for this longstanding pattern of human cycles.