Dawn dish soap and patience.
The best way is to pretreat with dawn dish soap, let it sit, and wash gently.
Sunscreen stains are mostly oil-based (that’s the zinc oxide and moisturizers binding to the fabric). Dish soap is designed to cut grease. Just rub a drop into the wet stain, let it sit for 15–30 minutes, then rinse with cold water. Repeat if needed. Then hand wash or machine wash delicate with a gentle detergent.
Don’t use bleach — it can set the stain or wreck the fabric. And don’t dry the suit until you’re sure the stain is gone, because heat locks it in.
This works on spandex, nylon, and polyester blends (aka most swimwear). For stubborn stains, hydrogen peroxide (not bleach) can help. Just test on a hidden spot first.
Your swimsuit will outlive the stain.
