I am trying to add an on/off switch to a power cord.
i opened up the cord and there is a black and white wires in there. I know that the switch will work on either one, but is there a better wire to choose from safety's perspective ?
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.