Ezra made a number of decrees in his lifetime, and one of them was a requirement to wash one's clothes on Thursday in honor of Shabbat. Indeed, this is codified as halacha. The reason for Ezra’s enactment was to ensure that people would be free on Fridays to tend to the many other time-consuming Shabbat preparations, and not have to be occupied with doing the laundry. It also ensures that no unforeseen mishap will prevent one from having clean clothes for Shabbat. For example, should one’s washing machine break down when doing the laundry on Thursday, one would have ample time to have the machine fixed or to complete one’s laundry at a friend or neighbor. If one’s machine broke down on a Friday, however, one may be left with no clean clothes for Shabbat. One should even avoid having one’s non-Jewish maid do the laundry on Fridays.
Rav Shlomo Zalman Auerbach offers an additional explanation for Ezra's enactment. He suggests that since people generally do not wear clothes the same day they are laundered, doing laundry on Thursday has the added benefit of being an activity which demonstrates that one has begun preparing for Shabbat. If one were to do the laundry on Friday, however, it would not be obvious that the clothes are being laundered in honor of Shabbat.
Similarly, one should be sure to do all Yom Tov-related laundry before Erev Yom Tov. However, when Yom Tov falls out on a Monday, it is permitted to do the Yom Tov-related laundry on Sunday if one was unable to do it on the days preceding Shabbat. So too, when Tisha B'av falls out on a Thursday, the Shabbat-related laundry should begin immediately after the fast has ended. It should not be postponed until Friday morning.
There is some discussion whether Ezra's intention was that laundry should be done specifically on Thursdays, or rather, if his intention was simply that laundry not be done on Fridays. As such, some authorities rule that washing clothes in honor of Shabbat on other days of the week is perfectly acceptable, as well. Some authorities suggest that even those who generally do their Shabbat-related laundry on other days of the week should leave over some laundry to be done on Thursday in order to comply with Ezra's decree. There are those who teach that there are kabalistic benefits to doing laundry on Thursdays.
It is very important to have clean clothes for Shabbat, and therefore, one should not wear the same Shabbat shirt or suit too many times without washing it. So too, washing one's Shabbat clothes often allows one the repeated opportunity to comply with Ezra's decree, if one washes them on Thursday. According to some authorities, the ban on doing laundry on Fridays begins Thursday night at sunset, while others maintain that it only applies from daybreak on Friday.
A number of authorities rule that one need not be overly particular to comply with Ezra's enactment nowadays, and that it is completely permissible to do laundry on Fridays. Among the reasons for this is that, in Talmudic times, doing the laundry was an extremely time-consuming endeavor, whereas today, it is accomplished by merely pressing a button. There was also the concern that clothes laundered on Friday would not be dry in time for Shabbat. Today, of course, with electric and gas dryers, there is no such concern. Therefore, one who is not pressured for time on Fridays is permitted to do the laundry then.
Yeshiva and seminary students are permitted to do their laundry on Fridays since they are generally not responsible for cooking or otherwise preparing the home for Shabbat. Children's clothing was never included in the decree and may be washed on Fridays without hesitation, if need be. While it remains ideal to ensure that the laundry is completed before Friday, one who was unable to do it earlier, may do it then.
 Bava Kama 82a.
 Rambam, Hilchot Shabbat 30:3; OC 242:1.
 Rosh, Bava Kama 82a; Magen Avraham 242:3; Mishna Berura 242:5. See also Rivevot V’yovlot 4:106, Halichot Bat Yisrael 15:3.
 Eliya Rabba 242:9.
 Chut Shani, Shabbat 3:1.
 Shemirat Shabbat K’hilchata 42 note 13.
 Rivevot Ephraim 5:369.
 Shemirat Shabbat K'hilchata 42:13; Pri Megadim, EA 534:1.
 Shemirat Shabbat K'hilchata 42:15; L'horot Natan 2:38; Or L'tzion 3:29:26.
 Shaar Hatziun 242:16.
 Ben Ish Chai, Lech Lecha; Kaf Hachaim, OC 242:19.
 Kaf Hachaim (Palagi) 26:11.
 Mishna Berura 242:5.
 Chut Hashani, Shabbat Vol. 1 p.50.
 L'horot Natan 2:38:2.
 Kaf Hachaim OC 242:20.
 Avnei Yashfei 1:49; Or L’tzion 2:16:1; Shevet Hakehati 2:104; Halichot Olam 3 p. 50; Shemirat Shabbat K'hilchata 42:13.
 Kol Avrech 1:12 cited in Rivevot V’yovlot 3:70.
 Or L'tzion 2:16.
 Kaf Hachaim OC 242:20; Ben Ish Chai, Lech Lecha; Yalkut Yosef 242:8; Rivevot V’yovlot 3:70.