It's easy to forget that having a good quality of sleep is as essential as having enough of it. Sleep quality, however, is not an ambiguous term and can mean a lot of different things.
Good quality sleep is:
balanced in terms of different sleep phases
All sleep phases are important
Sleep can be categorized into different stages, all having a separate function. After falling asleep, your brain will transition first to a stage called light sleep, which is followed by non-REM deep sleep, and eventually REM-sleep. Your sleep continues to alternate between these different stages on around 90-minute cycle, but the relative amount of different stages can differ around the night quite a lot. Especially at the beginning of the night, there is more deep sleep, and towards the end of the night, the amount of REM-sleep increases. To feel fresh and energized, your brain must get enough non-REM deep sleep as well as REM-sleep. You can not really do anything to try to increase the amount of one type of sleep during the day, as sleep is a process and sleep stages occur normally as long as you get enough sleep at the right time. However, certain things such as alcohol consumption or overeating before bedtime can alter the structure of sleep cycles, reducing the quality of sleep.
Attention! Some sleep trackers try to estimate the different sleep stages you had in your sleep. You should spend too much time looking at these, as they have a large margin of error in their measurements. Truly reliable detection of different sleep stages currently requires electroencephalography.
Continuous period sleep is the most restorative. Waking up during the night, disrupt your sleep cycles and make your sleep stages shallower. This restricts your brain and body from recovering fully from yesterday's activity. You might not notice the times you wake up during the night, as they are hard to remember in the morning. Making it also difficult to connect today's fatigue with last night's poor quality sleep.
Example Habits to try:
Walker, M. (2017). Why we sleep: Unlocking the power of sleep and dreams. Simon and Schuster.