Sleep-wake transitions, wakefulness, and motor functions are controlled by a part of the midbrain called the reticular activating system (RAS)

When we are wakeful and conscious, the neurons in the RAS engage in low-voltage burst firing (several neurons fire off at low voltages continuously). This is also true during REM sleep, which is where we experience intense dreaming. The opposite happens during deep non-REM (NREM) sleep, where high-voltage slow firing of RAS neurons will happen. It’s a method to track and control the wakeful state of the human body. The RAS is also a key factor of consciousness

A lot of sites and articles seem to point out another function of the RAS - the ability to parse incoming stimuli and filter out what isn’t conducive to our goals. If we have experience cognitive filtering moments such as thinking excitedly about having bought a red car and then seeing a lot of red cars wherever we go, that is attributed to the RAS. People suggest that success happens when we really think about our goals and envision the outcome. That way, the RAS would work for us by filtering out what isn’t supportive of the goal and would show us the entities that will be. I don’t quite know how true this is or if this is yet another one of those clickbait WhatsApp-forward style hoaxes though. Further research needs to be done!

Keeping us awake during bright light exposure is the job of the RHT and SCN. Together, the RHT, SCN, and RAS of the brain play a major role in regulating our sleepiness, wakefulness, and everything in between