1:5

וַיִּקְרָא אֱלֹהִים לָאוֹר יוֹם וְלַחֹשֶׁךְ קָרָא לָיְלָה וַיְהִי־עֶרֶב וַיְהִי־בֹקֶר יוֹם אֶחָד׃

The Almighty called the light Day, and the darkness He called Night. And there was evening, and there was morning: one day.

Bereshit 1:5

וַיִּקְרָא אֱלֹהִים לָאוֹר

Bereshit / Genesis 1:5 · Sod

Bereshit 1:5

וַיִּקְרָא אֱלֹהִים לָאוֹר יוֹם וְלַחֹשֶׁךְ קָרָא לָיְלָה וַיְהִי־עֶרֶב וַיְהִי־בֹקֶר יוֹם אֶחָד׃

The Almighty called the light Day, and the darkness He called Night. And there was evening, and there was morning: one day.

Sod סוֹד

Darkness that holds up the light

Why does the hard part usually come before the good? The verse puts evening before morning, and the sages explain why.

Darkness, teaches Baal HaSulam, is not the enemy of light but its support, like oil and wick for a flame. That is why evening comes before morning: first the difficulty, then the joy, and for Kedushat Levi first fear of God, then love of Him. Once the excess is separated, evening and morning become one day.

How Ba'al Shem Tov, Baal HaSulam, and Kedushat Levi explain it

Ba'al Shem Tov And there was evening, and there was morning: one day

One has to separate and remove the outer layer, the husk and the darkness, that is, the stray thought, and draw out of it the light of holiness that was hidden in it. And once the separation is made, the joy and the advantage that the light gains from the darkness make each one a support for the other. So I wrote in the name of my teacher, of blessed memory, explaining the midrash "and there was evening: these are the deeds of the wicked" and so on.

This is what is written: "And there was evening, and there was morning: one day." That is, after the separation, the evening becomes a support for the morning. That is why both together, the evening and the morning, are called "one day".

(Toldot Yaakov Yosef, Bereshit 209a, and Emor 116d, and in his name in the book Rav Yeivi, Tehillim / Psalms 50)

Baal HaSulam And there was evening, and there was morning: one day

From what was said we understand the secret of the night that comes before the day, as it is written: "And there was evening, and there was morning" (Bereshit / Genesis 1:5). All of creation exists in thought, in order to give delight to those He created, even though they are utterly small, as it is written: "As great as Your power is, so You determined our smallness." Even so, the Holy One, blessed is He, wanted to give them delight generously. To make it possible for them to receive this gift, He prepared the darkness, which is like oil and a wick: the light can cling to it. In the sense of the words: "Like the advantage of light over darkness" (Kohelet / Ecclesiastes 2:13). And it is well understood why, in the work of the beginning of creation, evening comes before morning.

Baal HaSulam And the Almighty called the light Day, and the darkness He called Night

The secret of day and night is explained in the verse of the first day of creation: "And the Almighty called the light Day, and the darkness He called Night" (Bereshit / Genesis 1:5). That is, all illumination and delight is called day, and all darkness and suffering is called night.

Kedushat Levi And there was evening, and there was morning

With this one can explain the question in the Talmud (Shabbat 77b): why do goats walk in front and then the sheep? Goats stand for fear (יִרְאָה), which flows from the attribute of strength and restraint (גְּבוּרָה). And sheep (אִימְּרָא) stand for love, as it says: "You have chosen (הֶאֱמַרְתָּ) the Eternal today, and the Eternal has chosen you (הֶאֱמִירְךָ) today" and so on (Devarim / Deuteronomy 26:17-18).

This is the meaning of the question "why do goats walk in front and then the sheep": why must there first be fear and then love? And he answered him: as at the creation of the world, first darkness and then light, as it says: "And there was evening, and there was morning." First there must be the attribute of night and then the attribute of day. So too there must first be fear and then love, and so on.

The goal of serving God is for a person to purify his soul in Him until he reaches such closeness (דְּבֵקוּת) that serving Him is sweeter to him than all his own good things. Then he will give himself and his soul to this service, as our fathers did at the Sea of Reeds (יַם סוּף).

They walked into the sea up to their nostrils at the word of the Eternal, given through His servant, faithful in all His house. Our Sages said that Moshe (Moses) our teacher told them: "The sea will not stand before you." In this faith they put their trust and walked on until the water reached their nostrils. Of this it is said: "Save us, Almighty, for the waters have come up to the soul" (Tehillim / Psalms 69:2).

And because they believed with such faith, holding His word dearer than their own life, they merited to rise higher than the ministering angels.

Takeaway

"The advantage of light over darkness" are words of Scripture: "And I saw that wisdom has an advantage over folly, as light has an advantage over darkness" (Kohelet / Ecclesiastes 2:13).
The "I" in this text is Rabbi Yaakov Yosef of Polonne, and "my teacher" is the Ba'al Shem Tov, the founder of Chasidism, and the midrash he refers to is this: "And there was evening: these are the deeds of the wicked. And there was morning: these are the deeds of the righteous" (Bereshit Rabbah 3).
Baal HaSulam explains in one of his essays why evening comes before morning: the darkness was prepared like oil and a wick for the light to hold on to, and in another he calls all illumination and delight day, and all darkness and suffering night.
The midrash in the Drash of this verse reads the same words differently, as the deeds of the righteous and the wicked (Bereshit Rabbah 3:8).