An automatic washing machine works by first filling the drum with water, then agitating the clothes to loosen dirt and grime. The machine then drains the dirty water, rinses the clothes with clean water, and may spin the clothes to remove excess water before stopping.