To get started, unfold socks completely before preparing them for washing. Set the machine on regular wash, switch to hot water, and use detergent and baking soda.
If heavily soiled, they may need a prewash. Fill a small tub with warm water and hydrogen peroxide, and let your socks soak for up to an hour before washing.
A TikToker suggests The Pink Stuff's Non-Bio Laundry Liquid is also an excellent prewash treatment. At the end of a wash cycle, add ¼ cup baking soda to help break down soil.
At the end of the final wash cycle, add ½ cup of white vinegar to ensure soil and other hard residues are removed. For hand washers, use white vinegar near the end of the wash.