Which color wire do I connect the switch to on a power cord?
The proper wire to insert the switch into is the black, or "hot" wire. The reason for this is because if you put the switch on the white or "neutral" wire, you will still have an energized plug at the other end that has potential to ground and is no safer than not having the switch at all.

This is all irrelevant though if you do not have a polarized plug or if you force the male plug into the outlet the "wrong" way.

It is probably easier and cheaper to buy a new extension cord with a factory made switch.