Daily Zohar 4158
Holy Zohar text. Daily Zohar -4158

Hebrew translation:

136. פָּתַח רַבִּי שִׁמְעוֹן וְאָמַר, בֹּא רְאֵה, כָּתוּב (קהלת ז) אֶת הַכֹּל רָאִיתִי בִּימֵי הֶבְלֵי יֵשׁ צַדִּיק אֹבֵד בְּצִדְקוֹ וְיֵשׁ רָשָׁע מַאֲרִיךְ בְּרָעָתוֹ. שְׁלֹמֹה שֶׁהָיְתָה חָכְמָתוֹ יְתֵרָה (מְכֻבֶּדֶת) עַל הַכֹּל, מַה הוּא אָמַר בַּפָּסוּק הַזֶּה? אֶלָּא שְׁלֹמֹה רָמַז רֶמֶז שֶׁל חָכְמָה, שֶׁהֲרֵי רָאִינוּ שֶׁדַּרְכֵי הַקָּדוֹשׁ בָּרוּךְ הוּא אֵינָם כָּךְ, שֶׁהֲרֵי כָּתוּב וְלָתֵת לְאִישׁ כִּדְרָכָיו וְכִפְרִי מַעֲלָלָיו. אֶלָּא שְׁנֵי עִנְיָנִים הֵם שֶׁכָּאן רָמַז.
137. שֶׁשָּׁנִינוּ, כְּשֶׁעֵינֵי הַקָּדוֹשׁ בָּרוּךְ הוּא רוֹצִים לְהַשְׁגִּיחַ בָּעוֹלָם וּלְעַיֵּן בּוֹ, כְּמוֹ שֶׁכָּתוּב (עֵינֵי ה’ הֵמָּה מְשׁוֹטְטִים בְּכָל הָאָרֶץ (זכריה ד), וְכָתוּב כִּי וְגוֹ’) כִּי ה’ עֵינָיו מְשׁוֹטְטוֹת בְּכָל הָאָרֶץ, וְנִמְצָאִים רְשָׁעִים בָּעוֹלָם, אוֹתוֹ צַדִּיק שֶׁנִּמְצָא בַּדּוֹר נִתְפָּס בְּחֶטְאָם, וְלָרְשָׁעִים מַאֲרִיךְ הַקָּדוֹשׁ בָּרוּךְ הוּא רָגְזוֹ עִמָּהֶם עַד שֶׁיָּשׁוּבוּ, וְאִם לֹא – לֹא יִמָּצֵא מִי שֶׁיְּבַקֵּשׁ עֲלֵיהֶם רַחֲמִים. זֶהוּ שֶׁכָּתוּב יֵשׁ צַדִּיק אֹבֵד בְּצִדְקוֹ, מִשּׁוּם שֶׁאוֹתוֹ צַדִּיק הִסְתַּלֵּק מֵהָעוֹלָם.


Zohar Bo
Continued from previous DZ
Ecclesiastes 7:15
“אֶת הַכֹּל רָאִיתִי בִּימֵי הֶבְלִי יֵשׁ צַדִּיק אֹבֵד בְּצִדְקוֹ וְיֵשׁ רָשָׁע מַאֲרִיךְ בְּרָעָתוֹ.”
“I have seen everything in my days of vanity: There is a just man who perishes in his righteousness, And there is a wicked man who prolongs life in his wickedness.”

Rabbi Shimon asks, what did King Solomon, with wisdom greater than any man, mean when he said these words? He continues to explain that Solomon implied that the ways of Hashem are not so, as we read in Jeremiah 17:10
“אֲנִי יְהוָה חֹקֵר לֵב בֹּחֵן כְּלָיוֹת וְלָתֵת לְאִישׁ כדרכו [כִּדְרָכָיו] כִּפְרִי מַעֲלָלָיו.”
“I, YHVH, search the heart, I test the mind, Even to give every man according to his ways, According to the fruit of his doings.”

We learned that the Holy One, Blessed be He watches over the world and examines it as we read in 2 Chronicles 16:9
“כִּי יְהוָה עֵינָיו מְשֹׁטְטוֹת בְּכָל הָאָרֶץ לְהִתְחַזֵּק עִם לְבָבָם שָׁלֵם אֵלָיו נִסְכַּלְתָּ עַל זֹאת כִּי מֵעַתָּה יֵשׁ עִמְּךָ מִלְחָמוֹת.”
“For the eyes of YHVH run to and from throughout the whole earth, to show Himself strong on behalf of those whose heart is loyal to Him. In this, you have done foolishly; therefore, from now on, you shall have wars.”

The righteous one in the generation is caught for the wickedness of the wicked that Hashem finds in the world. The Holy One, Blessed be, holds his judgment to give them opportunities to repent, and if they do not do Teshuva, there will be no one to ask for mercy on them because the righteous one is already dead.
“A Tzadik perishes in his righteousness” because he departed from the world so that he does not ask for mercy for the generation.

Tzadikim have the Light of the Torah in them, and they can push away the darkness. The other side always challenges them, but the strength of the Torah in them keeps them pure. After they complete their own soul correction, they may stay in this world to guide and elevate others to higher spiritual levels.
They make efforts to bring every soul they can reach under the protection and Light of the Torah through its studies.
When wicked people continue their evil ways, the prayers of the Tzadikim block judgments from coming to the world. To correct the world and punish the wicked, Hashem takes one or more Tzadikim to allow judgments to take place and do the necessary cleansing of evil.
Even though the Tzadik wants to live longer and use every moment to make more mitzvahs to expand his soul, the rewards and the rest in the Garden of Eden are welcomed by them.