Turn off the circuit breaker or remove the fuse from the fuse box that controls the light fixture.
Position the ladder beneath the recessed lighting and have a helper hold the ladder while you climb.
Remove the glass cover over the light you are working on. The cover typically either slides off or unscrews, if it's a round cover.
Unscrew and remove the lightbulb, then take out the two screws in the ceramic socket on each side of the bulb holder.
Pull down on the socket and turn it to the side to expose the wiring. Loosen the two screws in the side of the fixture to pull off the two wires. Make a note of which wire attaches to which terminal screw.
Wrap the new wires around the screw posts on the new ceramic socket and tighten each with the screwdriver.
Secure the new socket to the ceiling with the two screws removed in Step 4.
Install a lightbulb in the socket.
Slide in or screw on the lens cover for the recessed lighting fixture.
Restore power at the circuit breaker or fuse box.