Always wash your whites separately from even light coloured clothing to prevent dye transfer. Wash each load with a little oxiclean or bleach and do not let stains set in.
The beast thing for white clothing is bleach. Check the label to make sure it can be used though. For stubborn stain let it soak in warm water and bleach.
To keep my white clothes looking spotless I use Oxyclean. I first pretreat the fabric with a scoop of Oxyclean in a sink of warm water. I let it soak for 15 minutes. I wring it out and toss it into the washer with detergent and another scoop of Oxyclean.