Regularly check the insides of your dishwasher if rust has gotten into the metal parts. If it did, then here are some steps to clean them up:
Buy a dishwasher detergent that has rest remover in it. You can easily buy this in a grocery store.
Pur some amount of the rust remover onto the top tray and on the bottom tray of the dishasher. You can also apply some detergent on the walls of the dishwasher.
Turn hot water on. The higher the temperature of the water, the better the results will be.
Set the dishwasher to the longest and hottest cycle. Turn the dishwasher on. Repeat until you reach desired effect.