Replacing light fixture
If you have 3 wires at the light fixture (not including grounding wires)  you need to check voltage, find 120 volts, TURN OFF THE CIRCUIT, connect the white to the neural wire and the black to the wire carrying 120v. Make sure you cap the other wire regardless of the voltage it is carrying, it could be dead because of a disconnect, switch/ breaker etc. Be careful and if you don't understand how to do what I just said, get help.