I've noticed that when I'm severely tried, and only then, that just as I'm about to doze off, I get this flash of like, with a slight jolt in my body (not huge, like my body doesn't move, but I feel it). The light is almost always a brownish color, but once it was bright white.. what could cause this?

I have a history of anxiety, if that helps any.. thanks