If you are getting brown or rust coloured spots on your laundry after washing here are a few possible causes to investigate.
Metal objects that may have been left inside pockets such as nails or paper clips might be one cause of the stains. These often get stuck in the outer drum under the stainless steel drum and start to rust. Over time this rust could be deposited on clothes.
Check the pump filter in case anything is in there, but if metal objects are inside the main drum it may be difficult to retrieve them (how to remove something stuck in washing machine).
It’s also possible to get rust or iron coming through the water supply. If you suspect this, try holding a white piece of cloth under the tap and let water run through it for a few minutes. See if a brown stain appears.
If the water is staining the white garment brown, run water through other taps before starting the washing machine to try and get most of the water out of the pipework. Also check the filters in the water valves to make sure they are clean. You need to turn off the water tap and unscrew the fill hose from the water valve. You may need to consult a plumber or water authority if you are getting stained water coming through the water supply.
Treatment of rust spots
Try covering mild stains with salt, then squeeze lemon juice over the salt and leave overnight. Then rinse thoroughly and wash normally. There are rust remover products available for this problem for more serious stains.
Brown spots caused by rust from drum bearings
A more rare cause could be actual rust from the drum bearings where the seal protecting them has allowed water into them. If this is the case you should also be finding the washer noisy on spin, check this article for further details what do noisy drum bearings sound like?