Turn off the circuit breaker that supplies power to the old doorbell. Even though most doorbells are wired with a low-voltage transformer, there is still the danger of electric shock.
Backtrack the doorbell wires until you find the transformer, usually mounted on an existing electrical box. Disconnect the low-voltage wires by removing them from the screw terminals. Open the box cover and locate the wires that connect the transformer to the existing house wiring. The transformer wires could be either two black wires or a black wire and a white wire.
After confirming that the power is off, disconnect the transformer wires and replace any wire connectors that were removed during the process. Replace the box cover. Turn the circuit breaker back on to make sure the transformer is no longer supplying power. Secure disconnected wires to the wall or ceiling to prevent them from getting in the way.
If at any time you are unsure of the procedures listed above, please seek help from a qualified electrician.
Using a voltage tester is a simple way to confirm that the power is off.