The results show that during slow wave sleep, the largest connections are maintained while the smaller ones are lost. This brain mechanism improves the signal-to-noise ratio — important information remains and the dispensable is discarded — and allows the storage of various types of information from one day to the next without losing the previous data. That is, those that have already been considered relevant are kept in that state without having to reinforce them. According to González Rueda, the brain “puts order” during the hours of sleep, discarding the weakest connections to ensure stronger and consolidated memories.

Source: The brain puts the memories warehouse in order while we sleep — ScienceDaily

Some very important information on why sleep is important!