The colour of your new beachwear can be strongly affected by salt crystals in the sea water or chlorine residue from swimming pools. To stop the colours from fading, always wash your beachwear in clear water directly after you've worn it.
However, just rinsing swimwear isn't enough if you want to keep it in the optimum condition. Once you're home, you can put your beachwear into any modern washing machine, safe in the knowledge that it will be okay. Wash it at 30-40°C on a fine wash or silk cycle. This is gentle enough on the fabric while still ensuring that it's washed thoroughly to remove any dirt or oil. If you're still unsure, you can put the pieces into a laundry bag first to protect them. However, you shouldn't use fabric softener because of the fabric's elasticity.