My son used to wear white socks outside with no shoes on. They were awful. I used to put them in the washer and presoak with about a fourth cup of dry dishwasher detergent. They came out sparkling clean.
But, I told him he was going to have to do all his own laundry if he did not stop wearing them outside.