Replacement usually enters the conversation after repair has already been tried, or when a fixture is old enough that another repair doesn't make financial sense. It's also common when a homeowner wants to upgrade during a remodel.
The pages below cover replacement by fixture, since the decision points — and the installation process — differ quite a bit between a faucet and a water heater.