A water heater rarely fails all at once. A heating element or thermostat wearing out shows up first as water that is warm but not hot, or that runs out faster than it used to. A popping or rumbling sound during heating usually means sediment has built up on the bottom of the tank, insulating the burner or element from the water above it and making the unit work harder than it should just to keep up.
A tank that is actively leaking, especially from the bottom or a fitting that will not stay tight, is a different situation entirely: once the tank itself has started to corrode, patching a fitting only buys a little time. On site, the technician checks the age of the unit, the extent of any corrosion, and the cost of repair against replacement, so the decision is based on what is actually happening inside the tank.