The Zohar asks than why the flood killed all souls while there were high souls like Chanoch, Yered and others. The following verse explains that those righteous who existed when the land was dry died before the flood and therefore couldn’t protect the people at that time.

Genesis 7:22
“כֹּל אֲשֶׁר נִשְׁמַת-רוּחַ חַיִּים בְּאַפָּיו, מִכֹּל אֲשֶׁר בֶּחָרָבָה–מֵתוּ”
“Everything on the dry land in whose nostrils was the breath of life died.”

The Zohar explains in the paragraphs that follow these that Judah as the aspect of Malchut and soul level of Nefesh approached Joseph, who is higher and the aspect of Yessod and soul level of Ruach.
Immediately after this Joseph revealed himself to his brothers because their spiritual levels united.
Genesis 45:1 “ …Joseph made himself known to his brothers.”

Lesson: When we elevate our soul to a higher level we create opening to new and higher light in our lives.