First Step: Removing Solid Waste
Very important first step. Before you go to wash your diapers, make sure that you have rinsed any solid waste from your diapers. You can do this by either plopping spraying (using a bidet sprayer), scraping, or by dunking & swishing your diapers in the toilet or a bucket. Remember, solid poo always goes in the toilet! It is okay to put newborn poo directly into the washer as long as they are only consuming breast milk or formula and the poo is NOT clumping.
Second Step: Pre-Wash
Place your soiled diapers in your washing machine and set your machine to a light or quick wash on cool water. The purpose of this wash is to help flush some of the remaining residue and urine out of the diapers before you really get to cleaning them. You can use a small amount of detergent if you like. I like to add a little bit of oxyclean during this stage to help treat stains. Do not use fabric softener.
If your diapers are really really soiled or they've sat for many days, you can opt to extend the time of this pre-wash but the rest remains the same.
Third Step: Main Wash
This second, or main, wash is wear most of the cleaning happens. I prefer to set my machine to hot water on a heavy duty cycle with an extra rinse. I use Line 1 level of my preferred detergent (you can use any detergent you want; just don't use fabric softener). Adjust detergent more or less as you feel like you need, but I always recommend starting with Line 1.
My diapers are usually perfect for the next step when this cycle is done, but if they feel sticky or if you squeeze them and any bubbles form; do another rinse cycle.
Another tip: if you see any remaining stains, your diapers are still likely clean. Stains don't necessarily mean dirty. You can spot-treat and wash with the next load of regular laundry or move to the next step as you feel comfortable. Sunning is also a great way to treat stains naturally.
Fourth Step: Drying
All of my diapers are dryer safe on low heat. Hang drying the diaper shells is easier on the shells though, if you prefer. Inserts will take the longest to dry.