Washing machines remove the dirt and germs from our clothes, but a lot of that grime just ends up trapped in the machine itself. Fortunately, it's easy to clean your top-loader with a few basic supplies.
Regina Yunghans at Apartment Therapy wrote a great walkthrough to help you clean and disinfect your machine. Adding vinegar and bicarb soda to an empty wash cycle will do a fine job of disinfecting the wash tub, but cleaning the fabric softener well or those gross crevices under the lid will require some old-fashioned elbow grease and a toothbrush. You don't need to do this after every load, but giving your machine some care every few months will help keep dirt from accumulating inside and transferring to your (supposedly) clean clothes. Be sure to check the source link for the step-by-step guide.
How To Clean a Washing Machine [Apartment Therapy]