The right detergent
My best tip is to buy the laundry detergebt recommended by the manufacturer of your machine. Be especially careful to make sure that if you have a front loading machine, the detergent says it is safe for use in it.
Also, make sure to use the amount suggested. More soap does not mean cleaner clothes. It just means that you will be ruining the machine.