Debra wants to know how good sleep leads to a good memory and how disrupted sleep can lead to a poor memory. Well, memory is a three-step process that needs sleep in the middle. The first step is the received memory that is stored for short-term holding. The second step is where sleep gets involved.
During sleep, short term memories are reviewed and edited in preparation for their long term storage. The process is called memory consolidation. It works best with a sound sleep. Disrupted sleep tends to fragment such memories as they are being stored. A patient of mine, a neurologist says, the more sound the sleep, the more intact the memory lasts in long-term storage.
But even under ideal sleep circumstances, memory is seldom a perfect carbon copy of the original. Recalled memories are usually modified a little during their retrieval. Compare similar later accounts of different individuals from the same event.