What’s really the correct way to wash cloth diapers?

I’ve been told so much different ways and everyone says different. Some say cold water and no detergent for the pre-wash, then some say warm water and detergent.