putting new plug on wire. which wire connectswhere?
If you're talking about a ''polarized'' plug the hot wire (usually all black) will attach to the narrow side. And the neutral (usually with a white stripe) will attach to the fat side.
The wide prong is neutral and should connect to the white wire. The narrow plug is hot and should connect to the black wire. If the wires are not colored black and white and are instead in a traditional flat insulated power cord with an indentation between the two wires, feel both sides for a rib on one side that isn't there on the other side. the ribbed side is neutral. For a pair without a rib, but where you can see that one wire is copper colored and one is silver, the copper color is hot and the silver is neutral. Same goes for the screws you attach to on plugs or outlets not marked hot and neutral, copper or gold color usually is hot and silver is neutral. If all screws are the same color, this does not apply. Anyone can wire the existing system backwards or inconsistently, so do not rely on the convention for safety issues, just observe it for your own work and correct problems when you find them if you can do so safely. If not, consult an expert.
If the cord has three wires, black to the brass screw, white to the silver screw, and green to the green screw. If the cord has just black and white, ditto, except use a two-prong replacement plug, no green. If the cord is flat - no colors, just two wires side-by-side - the smooth side to the brass screw, the ribbed side to the silver screw.