127:18 It is good to fast and to repent in order to annul a bad dream, like fire on a wick, though specifically on that selfsame day. In any case, one is not required to fast, as Brachos 55b (citing Zechariah 10:2), “dreams tell falsehoods.” One is nevertheless obligated to repent and to occupy himself all that day in Torah study and prayer. Regarding a fast for a dream that falls on Shabbos, refer to OC 288. (A pregnant or nursing woman who has a disturbing dream should not fast; she should donate money to charity – Mishnah Brurah 220:5.)
128:1 From Rosh Chodesh Elul until after Yom Kippur is a time of G-d’s favor. While He accepts sincere repentance throughout the year, these days have been specially designated for repentance as days of mercy and favor. This is because it was on Rosh Chodesh Elul that Moshe ascended Mount Sinai to receive the second set of Tablets. He spent 40 days there, descending on 10 Tishrei, which was the end of atoning for the golden calf. Since then, these days have been designated as days of favor, with 10 Tishrei serving as the Day of Atonement (Yom Kippur). It is the custom in many places to fast on the day before Rosh Chodesh Elul and to recite the prayers of Yom Kippur Katan in order to prepare our hearts to repent. If Rosh Chodesh Elul fell on Shabbos, one would fast on the preceding Thursday.
Rabbi Isaac Luria (“the Ari”) wrote that, in Hebrew, the initial letters of the verse “Surely one does not lie in ambush, but it was G-d Who caused this to happen, so I will provide for you a place of refuge” (Exodus 21:13) spell out Elul, indicating that this month is our refuge, a time of favor when G-d accepts repentance for the sins that were committed throughout the year. It also alludes to sins committed accidentally, for which one would also need to repent during this month. The commentators also note that the initial letters of the phrases “And G-d will circumcise your heart and the hearts of your descendants” (Deuteronomy 30:6), “I am my Beloved’s and my Beloved is mine” (Shir HaShirim 6:3) “(sending gifts) a person to his friend and presents to the needy” (Esther 9:22) likewise spell Elul. These verses allude to repentance prayer, and charity – three things that must be eagerly embraced in this month.