To wash cloth diapers properly, it takes 2 consecutive cycles. One that serves as an effective pre-wash, and one that washes deeply. It is important to note that generally, the pre-washing available on washing machines is not sufficient.
The first cycle:
This should be a complete cycle at a maximum of 40 degrees, which lasts at least 30 minutes but can last longer. It should not be a delicate cycle or a simple rinse-spin.
It takes an energetic cycle that spins rapidly (1200 t/min). Spin is particularly important for the first cycle, as it is the one that allows urine and stool residue to be properly drained out of the fibers. Sometimes short cycles don't spin fast enough, in which case you have to add a spin alone after the first cycle, as fast as your machine can do. It is also important to look at how many kg the cycle is designed for. These kgs represent the weight of the dirty laundry to be washed (see your notice).
In a nutshell:
Minimum 30-minute cycle designed for the amount of kg to be washed (or more).
Maximum 40 degrees.
That spins at a minimum of 1200 t/min.
The second cycle:
It takes a cycle that lasts at least 1 hour and a half, 40 to 60 degrees. Energetic. The "cotton" and "white-color" programs are the most suitable. Do not choose the "eco" option that does not use enough water.
Make sure there also take a cycle designed for the number of kg to wash (or more). The quick spin here is mainly used to shorten the drying time. So the faster it is, the faster the laundry will be dry.
In a nutshell:
Cycle of at least 1h30 (90 min) designed for the amount of kg adapted.
And that spins well, to reduce the drying time.
Filling the drum for optimal washing: minimum 1/2 and maximum 2/3 of its volume.
Do not put a large bath towel (for example) to complete, it can trap the diapers inside during washing, preventing friction, and the diapers will be poorly washed.
It is necessary to know its type of water (soft, moderate, hard, very hard) in order to adapt the dosage of the detergent.
You should put the dosage for the highest degree of dirt, depending on what is recommended on the detergent box.
Not enough detergent: it won't wash well enough, there will be residues of urine, stool, and minerals, which will cause odors and irritation.
Too much detergent: there will be too much foam, it will prevent good friction, and therefore a good wash. In addition, the diapers will be poorly rinsed at the end of the wash.
For all the details about maintenance and the various types of cloth diapers, as well as all the questions related to cloth diapers, the book "Tout savoir sur les couches lavables" is very complete (in french).