An emergency with a water heater is usually one of two things: water that will not stop, or a house with no hot water at a time when it cannot be managed. The first ten minutes decide how much damage happens, and most of that work is done before any technician arrives.
First, stop the water
Close the valve on the cold line entering the top of the tank, turning it clockwise. If it is seized or will not hold, shut the main valve for the house. A tank that is leaking from the shell will keep discharging until the supply is closed; a tank leaking from a fitting may slow or stop when the pressure comes off.
Then remove the energy source. On a gas unit, turn the control to off; on an electric unit, switch the breaker off at the panel. Water and electricity are the combination worth avoiding, and a tank with a failed element can be live even when it is not heating.
Then contain what has already escaped
Towels, a wet vacuum, a bucket under the relief drain. Move anything that water ruins: cardboard, rugs, stored paperwork, the vacuum cleaner itself. If water is spreading toward a finished floor, a doorway dam of towels buys time.
If water has reached outlets, a panel, or an appliance connection, keep clear of it and call an electrician or the utility. A water heater problem inside a garage is a repair; water in an electrical panel is an emergency in its own right.
Gas is a utility call, not a repair call
If you smell gas, leave the building and call your gas utility from outside. Do not switch lights on or off, do not look for the leak, and do not relight the pilot. A repair visit happens after the space has been made safe by the utility.
What the phone line can do at 2am
The line is answered 24 hours a day, seven days a week, and the first useful thing it can do is talk through shutting the unit down safely. The hours describe the phone. They are not a promise that a technician will be at the door at that hour: if the leak is active or the household cannot go without hot water, say so and ask what is possible tonight.
What counts as urgent
Active discharge from a tank. Water at or near electrical equipment. A gas smell. A relief valve that keeps discharging after the supply has been shut and the tank has cooled. A house with no hot water where the occupants cannot manage, such as a household with an infant, an elderly resident or a medical need.
A slow drip that has stopped, a pilot that went out during a windy night, or a unit that is merely noisy can usually be scheduled.
After the water is off
The repair conversation starts. A tank that failed at the shell is a replacement. A tank that leaked at a valve or fitting is a repair that can wait for daylight. Either way, the decision is better made with the unit dry, the model visible and the age known, which is what the call will ask for.