Add 2 tablespoons of citric acid to the washing machine, or soak the socks for one hour in a mixture of one liter of warm water and three tablespoons of citric acid. Then wash as usual.