The structure of the brainstem, called the reticular formation, plays a crucial role in regulating sleep and wakefulness.