The single most important aspect to dishwasher maintenance is to keep the interior clean. Doing so keeps all the hoses and passages clear, which, in turn, lets the machine operate freely and ultimately washes your dishes better.
Most people use far too much soap when they run the dishwasher. Any more than 1 tablespoon is too much and will lead to a residue buildup that is hard to get rid of.
Never wash anything other than dishes in your dishwasher. Tools, clothes, sneakers, greasy range hood filters, and so on can leave harmful grease and residue that clog the machine's works and inhibit proper operation.
If you see interior staining or have soap residue buildup, it means your pump is working too hard to move water through the system. The best way to clean the interior is with citric acid. Use pure citric acid crystals, which you can find in grocery and drug stores. Fill your main soap cup and then run the dishwasher through a complete cycle. This is best done with the dishwasher empty. The crystals clean everything, including the unit's interior, racks, hoses, and water ports. Then, once a week, add 1 teaspoon of the acid crystals to your soap for general maintenance.
You can substitute Tang and lemonade mixes that contain Vitamin C (which is citric acid) for the crystals. They work well too, only with lesser amounts of citric acid per dose.
Dishwashers should be run at least once a week to keep all the seals moist and to prevent leaks and eventual failure from drying.
Periodically wipe the area around the seals to prevent soap scum buildup, which can cause a leak.