The Zohar, Chapter “VaYeshev (And Jacob Sat),” Item 114: There is not a person in the world who does not taste the taste of death at night, and the spirit of impurity is over the body. Because the holy soul has parted from man, the spirit of impurity is over that body and it is defiled.
This means that a person had a screen, the Light of Unity, the Light of Adhesion, and the quality of bestowal reigned inside him. But then everything disappeared. The Partzuf was emptied; all the Light came out of it. This could happen for an external reason or an inner reason, such as when a person’s inner will to enjoy grows and new Reshimot begin to surface in him.
That is when a new, uncorrected desire awakens in him and reigns over him. A person submits to it, and guided by this desire begins to think about his life, about self-gratification and how to fulfill this desire.
Only if he prepared ahead of time for this darkness, for the night, the state when his desires rule over him, then he is able to gather all the forces that enable him to view the darkness as a means to ascend to a new level. Then he makes a true request upward, to Abba ve Ima, asking them to take care of him (this is called “adhesion at midnight”).
From midnight onward, he begins the corrections. A person begins to correct the entire additional desire to enjoy, which he had received and in which he felt the taste of death. But now he sweetens it.
This means that a person advances toward the morning, when he receives from Above the Light that Reforms, the first quality of bestowal. And then the dawn comes. A person begins to feel Light in his state, since he has acquired a screen over his previous desire to enjoy and he is now in the quality of bestowal.
This is why it had been necessary for him to experience the taste of death.