Replacing bathroom light fixtures is nearly identical to replacing or installing a light in any other room. The biggest differences are the positioning and decorative features. The vast majority of bathroom light fixtures have 3 wires with which to connect to a circuit.
WARNING: Before you set about replacing the fixture, make sure you know how much weight you will be placing on the wall or ceiling. Anything more than 50-pounds requires supplemental support. Do not overload the circuit when you connect the new fixture.
Step 1 - Remove Current Fixture
Turn off the power to the circuit. There may be screws visible, or you may have to pop or pry off a cover. Remove the glass bulb covers and bulbs first, then remove the rest of the fixture so that the wiring is exposed.
Step 2 - Test the Circuit
Use the voltage tester to make sure that the power to the circuit is not flowing. Hold the tester against the hot wire to get an indication. If a light comes on, power is still flowing. Go to the main panel, locate the correct circuit breaker, and turn it off.
Step 3 - Disconnect the Fixture
The wires attached to the fixture will likely be pigtailed to the circuit wires. If they are connected by nuts, then you can be sure they are pigtailed. Unscrew the wire nuts from the connected wires. If there is a third wire nut over the ground wire, disconnect it as well. Separate the individual wires.
Step 4 - Reconnect the New Fixture
It may help to have someone else hold the fixture while you make the connections. Join the white wires, the black wires, the green, and the bare copper wires by holding them with pliers and twisting. Screw a wire nut onto each new pair. Use new wire nuts if the old ones are worn.
Step 5 - Install the Fixture
Before you set everything into place, turn the circuit back on and test the switch. If you reconnected everything just like it was when you disconnected the original fixture, the switch and light should work. Stuff the wires into the light box and mount the fixture with the screws provided. If it weighs less than 50 pounds, the fixture should mount onto the light box. The casing or covering will snap or screw onto the main fixture.
Replace the bulbs and bulb covers and test your work. If for some reason, the switch and light do not work, check your connections to make sure you wired everything correctly.