People's techniques will vary so you might get some contradiction in the thread!
I tend to wash everything at 40. Check for stains when I put things into the wash, and use a multi-purpose stain remover spray on spot stains. The things I find the multi-purpose stain remover doesn't work well on are grease/oil/fat stains, and blood. If you look in the luandry section of a large supermarket or somewhere like Robert Dyas, you will find an array of specific stain removers. I have one for oil and one for blood/protein (it apparently also works on egg and sperm XD) plus one for sweat and deodorant, which I use on any whiffy armpit tops, which tend to be mine (pregnancy/BF hormones) or teen DS1. DS1 used to get fairly regular nosebleeds, which is why I bought the blood remover one.
If a stain is still visible after going through the wash, I dry it in as direct sunlight as I can as the UV light helps to break down stains, particularly tomato, berries, carrot and that liquidy baby poo that gets everywhere. Also baby clothes with old milk/vomit marks that have developed in storage - sunlight gets those out too. Direct, bright sunlight is best, but a window is OK, outside on a rainy or cloudy day, even moonlight.
Certain substances are dyes, so they won't come out if you've managed to stain with them, no matter what you do. Turmeric (the bright yellow colour in a lot of curries), bleach (beware of "antibacterial" cleaning sprays, many contain bleach) and black coffee - coffee that has milk in it does tend to come out, though. Also things like hair dye and some kinds of paint/pen.
"Colour" detergent doesn't contain bleach so is better to preserve the colours of bright or dark items.
I do a maintenance wash at 90 every 6 months, or 3 months now I use pods. I've never used liquid so not sure about that. I don't know if I trust the auto dose machines but it might be I don't understand them. I found a YT channel Lord's Electrical very helpful on the topic of washing machine info.