Having passed 40, yeah, I have to admit I'm the same.
I have found a few remedies though.
One, having a flashlight in my hand. That way I know I can make it not dark, if I want to.
Two, playing music or known sounds. It is terrible how the mind suddenly goes to the absolute worst places when...