Typically, you'll find a red wire for the right earpiece, a white (or green) wire for the left earpiece, and one or two black or bare copper wires for the "ground" wire(s).

Summary:
Sort the wires by color.