The Midrash says regarding the verse (Devarim, 7), “For who is a great nation that has as god who is as close to him as Hashem our G-d is [to us] whenever we call Him?” that Rabbi Chanina and Rabbi Yehoshua say: “Which nation is like ours that knows the customs and laws of its G-d? The custom of the world is that when one has a judgment pending, one wears black clothing (i.e. when one has a judgment regarding life or death or regarding wealth or poverty, and the like, one is very worried and is not happy at all, and he most certainly does not take a haircut or wear his holiday finery before the court case); however, this is not so regarding the Jewish nation, as they wear white clothing, take haircuts, cut their nails, and eat and drink on Rosh Hashanah, for they know that Hashem shall perform a miracle for them.”
We thus customarily take haircuts and wash our clothing on Erev Rosh Hashanah and this is indeed a fine custom. Similarly, some have the custom to immerse themselves in a Mikveh on Erev Rosh Hashanah; if one cannot immerse in a Mikveh either because there is none in the vicinity where he resides or for any other reason, Maran Rabbeinu Ovadia Yosef zt”l writes that he may suffice with pouring nine Kabin (unit of measure) of water onto one’s self. Nine Kabin is equal to approximately twelve-and–a-half liters of water.
The Poskim disagree whether or not the pouring of these nine Kabin of water can be done through taking a shower by standing under a stream of water from the showerhead until one feels certain that nine Kabin of water have already been poured on him. Hagaon Chazon Ish writes that since the water exits the showerhead through small holes when taking a shower, it cannot be considered as though nine Kabin of water were poured onto one at once. Nevertheless, according to the opinion of Maran zt”l, one may do so using a shower. (Obviously, this form of purification through pouring nine Kabin of water on one’s self is not as effective as actually immersing in a Mikveh and it is equally obvious that this form of purification is effective only in lieu of a man’s immersion for purposes of holiness; however, regarding a woman’s purity, a woman will always remain impure until she immerses in a Mikveh as prescribed by Halacha.)
Regarding what the Midrash states that the Jewish nation is sure that Hashem shall perform a miracle for them and they therefore wear holiday attire etc., it is quite clear that Hashem will not perform a miracle for naught. G-d-forbid shall Hashem yield to one’s sins, as our Sages say that it is forbidden to say that Hashem yields to one’s sins. Rather, what this means to say is that the Jewish people are sure that as a result of their repentance, intensified prayer, and charity, Hashem shall forgive them, accept their prayers willingly, and inscribe them in the book of the truly righteous.