This will come as no surprise, but research reported by Cleveland Clinic Wellness confirms it: Your brain is better at retaining information when you get enough sleep:
In a recent study, researchers found that at night, the brain shrinks some of the connections between brain cells (called synapses) that have grown during the day. This “selective forgetting” is thought to make room for new information and skills. Other research has shown that memories and learning get consolidated during sleep.
If you’re not getting sufficient Zs, try maintaining a consistent bedtime and wake-up time, get as much sun as you can during the day, put down your screens an hour before hitting the sack, get regular exercise, and cut back on caffeine and alcohol. When those adjustments don’t cut it, talk with your doctor.