Here a new receptacle is added to a light fixture circuit. The connections at the light fixture are spliced and extended to the new receptacle. With this arrangement the new receptacle will turn off and on with the light fixture.
Another, more permanent, repair for an old doorbell circuit is to use a small ac adapter in place of the battery. Most people will have an AC adapter left after an old radio or similar device has long since died. Look for an output of 10 to 16 volts printed on the side of the adapter casing. Current ratings will typically be very low from these adapters, around 500mA, making them perfect to power the doorbell circuit. All that is needed is a conveniently located receptacle to plug the adapter in.
This diagram illustrates wiring for a circuit breaker with a built-in ground fault circuit interrupter. This 20 amp ground fault interrupter breaker is a form of gfci that can be installed at the circuit source. This kind of circuit is used for dishwashers, whirlpool spas and other locations where water contact is likely.
The neutral wire in this circuit is taken from the receptacle and spliced to the white on the new cable, and to a pigtail that runs back to the receptacle. The hot is spliced to the black cable wire and a pigtail back to hot on the receptacle.