Replacement chargers — voltage, amperage and plug type must match your pack.
Chargers fail more often than people expect. They get dropped, left in hot trunks, run on extension cords, and the small cooling fan inside gives up after a few years. When a bike stops charging, the charger is the first and cheapest thing to rule out, and a spare is also handy to keep at work so you are not carrying one back and forth. The catch is that a charger is not a universal accessory: the output voltage, the plug, and sometimes the pin polarity all have to match your pack.
The number that matters most is output voltage, and it is not the same as the battery's nominal voltage. A 36V pack charges to about 42V, a 48V pack to 54.6V, and a 52V pack to 58.8V. That is what the charger label should say. A charger with the wrong output either will not fully charge the pack or, worse, can push a pack past its limit and rely on the BMS to save it. Output current (amps) is the second number: most stock chargers are 2A, and 3A to 5A chargers charge faster but run warmer and are harder on cells over time.
Then there is the plug. Common e-bike charge connectors include round DC barrel plugs in a couple of sizes, three-pin XLR, and several styles of round aviation-type connectors, and the same-looking plug can be wired with different polarity by different brands. Compare your old charger's plug against photos carefully, and if the old charger is missing, check the bike maker's spec or ask the seller before ordering. Mismatched electrical parts can damage a controller or battery; if you are unsure which charger your bike takes, an E-Bike Assessment is the safe next step.