Three parts, and only one of them lives outdoors
A doorbell is the simplest circuit in the house. A transformer drops mains voltage to somewhere between eight and twenty-four volts, a button closes that circuit, and a chime turns the current into a strike against a metal bar. That is the whole system. Two of those three parts sit on the inside of a wall where nothing happens to them for twenty years. The third is screwed to the door frame, in the rain.
And the button is not a switch in the sense a light switch is. It is two brass strips held a millimetre apart by a spring, closed only while your finger is on it. That millimetre of air is open to the weather every second of every day. Moisture, road salt, dust and the sulphur compounds in city air settle in that gap, and brass in that environment grows a film of oxide — copper oxide first, brown, then green. Oxide is a semiconductor at best and an insulator at worst.
Here is the number that explains everything. A clean contact closes at a few hundredths of an ohm. An oxidised one can sit at twenty to fifty ohms. The transformer is a small device, typically ten volt-amperes; put thirty ohms in series with a chime coil and almost all of the voltage is dropped across the dirty contact instead of the coil. The coil cannot pull the striker. The bell does nothing. Nothing has failed, and yet replacing the chime, the transformer or the battery changes precisely nothing, because the energy is being spent in the gap outside the front door.
One sound, two halves of the system
Press the button with your ear against the chime box, not the button. That is the whole diagnostic and it costs nothing. If you hear a faint click from inside the box, current is arriving and the coil is working — your problem is mechanical, in the striker. If you hear nothing at all, no current is arriving, and the question becomes where it stopped.
To answer that, take the button off the wall. One screw underneath, or a cover that prises off. What you find behind it divides the two remaining faults cleanly: a coin cell and a small board means a wireless bell, and the battery is behind the button; two thin wires with no battery means a wired bell, and the brass strips are your suspects. This is the step almost everyone skips, because everyone assumes the battery goes in the chime — on most wireless sets, it does not. The chime is mains-powered or has its own cells, and the button has a second set that runs the transmitter, which is the part that actually dies first because it transmits every time someone walks past.
The clean that costs nothing, and the tool you must not use
Sandpaper, a nail file, or the rough side of a washing-up sponge, drawn through the gap a few times until the brass is bright again. Not a knife. A blade cuts below the oxide and takes the brass with it, and a scraped contact re-oxidises faster because you have given the corrosion a fresh, rough, larger surface. Work the strips, not the wires: a wire pulled out of its terminal is a much bigger job than a dirty contact.
Then put it back and press. If it rings, you have fixed it for the price of nothing, and you have learned the thing worth knowing: a doorbell that stops is nearly always a switch that got dirty, and the switch is outside. If it still does not ring with clean brass and a good cell, the fault is upstream, at the transformer or in the cable inside the wall — and that is where this page stops, because the other side of that transformer is mains voltage.