You should make sure to give your dishwasher a deep clean at least once a month.
This can be done using a dishwasher cleaning tablet.
However, you can also create your own cleaning solution for deep-cleaning your dishwasher.
For a homemade option, place a glass measuring cup filled with two cups of distilled white vinegar on the top rack and run a normal cycle without detergent or dishes.
If you prefer, you can also clean your dishwasher with baking soda by sprinkling a handful of soda into the bottom of your dishwasher.
After you have sprinkled the baking soda, run it through another quick wash cycle using the hottest water setting.