There is a level of sleep called the rapid eye movement (REM) stage of sleep. It's when your brain organizes and files the important information from your day. It also identifies unimportant details and files long-term memory.