Answer:
The first thing you want to do is wipe out the inside of your washing machine with a cloth to remove any loose dirt or grime. If you have a top-load washing machine with an agitator, you can remove the top of the agitator so it can be cleaned in your sink.
After you have done this, it's time to clean the inside. You will want to run a full wash cycle with no detergent. Use hot water and 1/2 cup to 1 cup of either white vinegar or bleach, depending on the size of your washing machine.
Vinegar is usually sufficient to clean your washing machine unless you have stains in your washer that you are trying to get rid of. For example, if you left an ink pen in your washer, you might have ink stains that you need to get rid of. If this is the case, bleach would be the better way to go.
After you run a full wash cycle on hot, your washing machine should be clean and ready to use again.