A water heater failure in a building is rarely contained to one apartment. Water finds the floor penetration, the chase and the ceiling below, and that is what turns a repair into a claim.
Stop the supply
The valve is where the cold supply meets the heater, or at the branch serving the unit. Closing it stops new water entering. Water already in the tank will drain out, so the priority shifts to keeping it away from structure and from the unit below.
Cut the energy
The gas valve on the supply pipe, or the breaker for an electric unit. This prevents the heater running while empty, which is how a part failure becomes a replacement.
A gas smell overrides everything else: get out and call the utility's emergency line from outside.
Tell us both ends
Which floor the heater is on, where the water is appearing, whether a ceiling below is staining or bulging, and whether the shut-off is accessible. Those details decide whether this is a plumbing call, a building call, or both.
If the ceiling below is bulging, water is trapped and the weight is a hazard. Keep clear of it and say so on the call.
What can wait
No hot water without a leak, a slow weep caught in a container, a unit that will not light, and a tankless unit throwing a code with no water present. Those are scheduled repairs. The repair page covers them.
After the water
Photograph the damage before cleaning up if a claim is likely, ventilate the space, and leave wet ceiling or flooring to dry properly rather than painting over it. Water that has reached insulation or a wall cavity is a restoration question.
Where the shell has failed, the replacement page covers the swap and the outage planning that goes with it.