If you're replacing a wired-in doorbell, use a battery tester or a meter to make sure everything is conductive all the way through. If it's not, there's a cut in the wire somewhere, and you're better off switching to a wireless doorbell.