Match your socks to your pants, not your shoes (or shirt). It visually extends your leg, making you appear taller. But they needn't match exactly—simply fall in the same hue. A shade lighter or darker is just fine.
Never wear socks while:
On the beach. Wearing driving moccasins. Having sex.