Hashem tells the Navi עמי נחמו נחמו that he should console the nation. How are we consoled? The answer is אלקיכם יאמר, that Hashem is our G-d. This awareness is in itself a condolence.
We can compare it to a child at an amusement park who is afraid to go on the roller coaster, the Ferris wheel, and the other tall rides. But when his father takes him on a ride, he feels secure and isn't afraid anymore.
Hashem is our G-d. That is our comfort. That is our guarantee that there is nothing to fear.
It states (Shir HaShirim 4:8), אתי כלה מלבנון אתי תבואי מלבנון. Rashi explains that Hashem says, מלבנון אתי, "I will be with you when you go to galus. תבואי מלבנון אתי, and I will be with you when you return from galus." Also, throughout galus Hashem is with us, as Rashi writes, "From when you leave... until you return, I am with you, wherever you go and come." Hashem is with us, guarding and helping us every step of our lives.
The Midrash (Devarim Rabba 2) relates: A ship stopped at an island. The captain asked the only Yid on board his boat to go to the island to buy provisions for the rest of the passengers. The Yid replied, "Why are you sending me, specifically? I don't know anyone on this island. I am alone on this island, just like you." The sailors told him, "You are not alone. Wherever you go, Hashem is with you. As it states (this week's parashah, 4:7) לו אשר גדול גוי מי כי אלקינו 'כה אליו קרובים אלקים, 'Which great nation has a god close to them like Hashem our G-d.'" The Beis Avraham zt'l would often repeat this Midrash, emphasizing that even goyim know that Hashem is with the Jewish nation. We are never alone.
Reb Shmuel Munkes zt'l, a student of the Baal HaTanya zt'l, was a very happy person.
Once, a fire destroyed Reb Shmuel's home, and Reb Shmuel was seen dancing. People feared that Reb Shmuel had lost his sanity due to his financial loss. Why was he dancing? He explained, "If I were a non-Jew, my god would be burned in the fire together with my home. But I'm a Yid, and my G-d still exists. That's why I'm so happy."
Hashem says (Yeshayah 51:12) הוא אנכי אנכי מנחמכם, "I am He Who consoles you" (from the haftarah of parashas Shoftim). Why does it state אנכי twice? It is explained that it alludes to two אנכיs that are written in the Torah. The Torah writes by the Aseres HaDibros אלקיך 'ה אנכי, "I am Hashem, your G-d," and when discussing the troubles of galus, the Torah (Devarim 31:18) states, ההוא ביום פני אסתיר הסתר אנכי, "I will hide My face on that day." These two אנכיs are alluded to in the words מנחמכם הוא אנכי אנכי. The Navi is saying that when one knows that even the אנכי of אסתיר הסתר אנכי is also אנכי אלקיך 'ה, this consoles us. When we know that even during hester panim, Hashem is with us, this consoles us.
