We know that soaps and detergents make oil and dirt present in a cloth dissolve in water, thereby making the cloth clean.
Soap has one polar end (the end with sodium or potassium ion) and one non-polar end (the end with fatty acid chain) as shown in the figure. The polar end is hydrophilic in nature i.e., this end is attracted towards water. The non-polar end is hydrophobic, but lipophilic in nature i.e., it is attracted towards hydrocarbons, but not attracted towards water.
A soap molecule
When soap is dissolved in water, its hydrophobic ends attach themselves to dirt and remove it from the cloth, as shown sequentially in the figure that follows.
Diagram representing the cleansing action of soap
First, the molecules of soap arrange themselves in micelle formation and trap the dirt at the centre of the cluster. These micelles remain suspended in water like particles in a colloidal solution. The various micelles present in water do not come together to form a precipitate as each micelle repels the other because of the ion-ion repulsion.
Thus, the dust particles remain trapped in micelles (which remain suspended) and are easily rinsed away with water. Hence, soap micelles remove dirt by dissolving it in water.
Hope this helps.