These are the Rules, as taught by my mother, as taught by her mother.
The rules can be deviated from once you have experience. Some of the common deviations are described at the bottom of the post with a footnote.
The rules all have reasons. Some reasons are complicated and will get skipped. Others get marked with a footnote.
The purpose of these rules are: Avoid unhygienic situations, avoid damaging clothes by exposing them to too-high temperatures, avoid mis-colored clothes by mixtures that are more likely to stain or by temperatures that are too high for the dyes.
For all cloth: Wash inside-out with zippers/buttons etc. closed.
For all cloth: Wash before use at 30°C.
Grouping by colors:
Clothes come in 4 colors, detergents in 4+1. Clothes are “Light, Dark, Red, Color,” and the +1 detergent is Bleaching White. Cloth is considered “light” if it is white, or if it could be mistaken for white in bad lighting or by somebody with a limited color vocabulary. Dark clothes same rule except “black” instead of “white.”
Clothes that have more than 50% non-light color are not light.
Clothes that have more than 10% red are are red.
First time wash: Alone, or with extremely similar colors, even if it doesn’t warn you to wash only with similar colors.
Second time and on: How much you split your wash up or join it together depends on how great a hurry you’re in and what detergents you have.
At the very basic, get two separate detergents – “white” and “color.”
Whites are to be washed separately. Dark can be grouped with either “Red” or with “Color,” and does not need to be considered a separate color until later.
Caution: Bleaching White detergent is only for actually-white clothes, others should be washed with non-bleaching white or (if you accidentally only purchased bleaching white) with color detergent.
Once you have Color and Non-bleaching White, supply up with Dark, Red and Bleaching White detergents as fits your wardrobe.
Grouping by temperature:
Underwear: At least 60°C, no matter the color, material or what the label says.
Very dity linen: You can go all the way up to 90°C if white, otherwise wash at 60°C but for longer.
Cotton: 30°C if non-white, otherwise 60°C if white.
Very dirty cotton: You can go all the way up to 60°C
Very dirty synthetics: 30°C, but for longer.
Wool: 30°C at most, see if your washing machine has an actual wool program, unless you are washing wool underwear in which case 60°C. Do not centrifuge wool.
Silk: I am unfamiliar with silk. I will instead link to this:
and ask you to pay attention to the fact that this is not hygienic. Do not purchase silk underwear.
In order of durability, Linen > cotton > synthetics > wool > silk. Some wools can endure washing machines, others cannot. I generally treat all wools like they’re synthetics, from the principle that I was never going to hand wash them anyway so worst case I cannot wear them because they’re ruined, same situation as before when I couldn’t wear them because they were dirty. This has so far ruined exactly zero wool garments for me but you should be aware of the possibility. Wool that you cannot endure losing (gift from your dead grandmother or w/e) you should hand wash using special wool soap.
 Washing machines exert wear on your clothes. You turn them inside-out so the wear is on the side that isn’t visible. You close buttons/zippers so they don’t get caught on each other and exert even more wear, and so they don’t knock into the cylinder and make noise.
 The first wash is to get rid of excess dye, chemicals used in cothing production, pesticides used while growing the materials etc. It shouldn’t be necessary but unfortunately it often is.
 The reasoning is that almost any colors can stain white, so don’t throw them into your whites wash. This is one of the rules that some experience can tell you when to ignore – in particular, if you have e.g. a white shirt with blue stripes, if the blue stripes aren’t miscoloring the rest of the white shirt, they probably will also not miscolor your other whites.
 The reasoning is that red can stain many other colors, so don’t throw them into your other-colors wash. Same deviation as above – if the red accent on a partially red garment isn’t staining the rest of the garment, it probably also will not stain your other garments. Just be very careful mixing reds with whites.
 Red+Dark is allowed because red staining does not show on dark clothes. Dark+Color is allowed because Dark and Color are washed exactly the same unless you have dark detergent or a dark program on your machine.
 Bleaching white is basically for white linen that has a tendency to acquire a yellowish sheen even when clean, but can be used for other completely-white clothes.
 You want it at 60 degrees to kill bacteria. If you have synthetic, silk or wool underwear, the label may warn you that this will ruin your underwear. This does not mean you wash synthetic/wool underwear differently, it means you should buy cotton underwear.
 High temperatures can be murder on colors