If there is no adequate supply of water to the machine, your dishes will still look dirty even after washing. A damaged inlet valve would reduce the quantity of water supply to the machine or if the inlet valve is old. These valves located the back of the lower kick panel should be replaced every 3 to 7 years depending on water conditions.
Always use the recommended amount of detergent, and the brand your manufacturer suggests if possible. Soft and hot water uses less detergent, while hard and cold water needs more to clean well.
Scrape excess food into your garbage disposal/disposer but skip the pre-rinsing and save the water. Most modern dishwashers are designed for food particle removal. No rinsing is needed unless your dishes and cookware have been left sitting out for several hours. In that case, you may need to soak them in soapy water to loosen particles before loading into the dishwasher.