Turn off the power to the circuit at the main electrical box.
Unscrew the mounting screws that keep the doorbell mounted to the house.
Pull the doorbell away from the house, and test the wires with a voltage tester. If you get a reading, switch off a different circuit and test the line again. Proceed to Step 4 only after you have shut off the circuit that controls the doorbell.
Loosen the terminal screws on the diode, and remove the wires. The diode is the flat plate behind the doorbell. Remove the diode and replace it with a new one.
Wrap the wire leading from the transformer around one of the terminal screws on the diode, and tighten the screw.
Wrap the wire leading to the doorbell button to the other terminal screw, and tighten the screw. The diode is now installed in the circuit.
Screw the doorbell back into place.
Restore power to the circuit, and test the doorbell.