An emergency with a water heater is nearly always about water and energy, not about the appliance. Stopping both quickly limits the damage; everything after that is a repair decision made in better conditions.
Step one: the water
The cold inlet valve sits where the supply pipe meets the top of the tank, and closing it is the one action that stops the situation getting worse. Water already inside will still drain out through a split shell, so the aim is to keep the total small and lift anything valuable off the floor.
Where the leak is at a fitting rather than the vessel, the same valve buys time to get a container underneath. If reaching it means stepping through water near an outlet, a panel or an appliance, leave it alone and call.
Step two: the energy
A gas unit has a valve on its supply pipe; an electric one has a breaker at the panel. Shutting either off prevents the unit heating a tank that is emptying, which is how a repairable fault becomes a damaged appliance. A burner running with water around it is a hazard on its own.
A gas smell changes the order entirely: leave, then call the utility from outside.
Step three: describe it well
Where the water comes from, what is shut off, whether the unit is still heating, the fuel type, the age, and whether the property can operate without hot water. Those details let the person on the phone decide urgency before anyone is dispatched.
What can wait for daylight
A working unit that has stopped producing hot water, a slow weep caught in a container, a pilot that will not hold, and lukewarm water are repair calls. They are uncomfortable rather than dangerous, and they get a scheduled visit. Calling them emergencies does not hurry them along.
When water has already spread
Dry what can be reached, keep the area ventilated, and photograph the damage before cleaning up if an insurance claim is likely. Water under a floor covering or inside a wall cavity is a restoration question rather than a plumbing one.
If the tank has failed at the shell, the next step is a replacement rather than a repair, and the repair page covers the faults that are only parts.