When you have no hot water in the apartment, the water heater may need repair. The landlord is responsible, so that's the first person to call.
5 Reasons You Have No Hot Water in Your Apartment

The Heating Element in an Electric Water Heater Blew
Most electric water heaters have two heating elements; oxygen in the tank water can gradually corrode them to the point where they stop working, causing no hot water in the apartment. Replacing a blown element is straightforward, but it requires the tank to be partially or fully drained.
As part of the procedure, the plumber will probably also replace the anode rod, which is there to prevent damage to the heating elements and the tank lining. It does this by preferentially attracting ions that would otherwise corrode other metal parts inside the tank, including the heating elements. In the process, the rod corrodes, so it should be replaced every five years or so.
How Long Will the Repair Take? The job shouldn’t take a plumber more than an hour or two. If they need to replace the anode rod, add 15 to 30 minutes to the repair.

The Pilot Light in a Gas Water Heater Went Out
Many gas water heaters have electronic ignition systems, but some have standing pilot lights that burn continuously. If the pilot goes out, the water heater won’t work and you’ll have no hot water in the apartment until someone relights it. If the landlord gives you permission to relight the pilot in the water heater in your apartment by yourself, you can usually find the procedure described on a label on the front of the tank. If not, you can always Google it.
A common reason the pilot goes out is a bad thermocouple, which keeps the gas valve open while the pilot is burning. If the thermocouple is bad, the pilot won’t stay lit.
How Long Will the Repair Take? A plumber should be able to replace the thermocouple in less than an hour.

There Was an Interruption in the Gas Supply or a Power Outage
If you get hot water from an electric water heater and there’s a prolonged power outage, you’ll have no hot water in the apartment until the power returns. There’s nothing you can do but wait for the power company to complete the necessary repairs.
If you have a gas water heater and the pilot goes out, the problem could be an interruption of gas service. It’s unusual for this to be caused by the utility company. It’s more likely that someone shut off a valve in the water heater supply valve. If you think this is what happened and you find the affected valve, call a plumber to turn it back on. Someone may have shut it off because of a leak somewhere.

The Water Heater Thermostat Malfunctioned or Is Set Too Low
On gas and electric water heaters, you set the water temperature by turning a dial on the front of the tank. If the water heater is in your apartment, and you don’t share the water with other units, adjusting this to a higher temperature should be safe without first contacting the landlord. Turn it up incrementally to avoid making the water so hot it could scorch you. The ideal temperature is somewhere between 120 and 140 F.
If the thermostat is already set to a high temperature and the water is cold, the thermostat may need to be replaced. If so, a plumber needs to do the job.
How Long Will the Repair Take? Gas water heaters are more complicated than electric water heaters, so repairing them will take longer.

The Water Heater Needs To Be Flushed or Replaced
A tank-style water heater’s life expectancy is 10 to 15 years, although it isn’t uncommon for people to keep one in service for much longer. The problem with an old water heater is that it’s had time to collect a thick layer of sediment on the bottom of the tank, and this affects its ability to heat water, especially if it’s a gas model.
A plumber can remove most of this sediment by flushing the tank, which is a process that takes several hours or close to a day if vinegar is used to dissolve scale. However, if the tank is old enough to collect sediment, it may also have frayed seams that are about to leak, so the plumber may recommend replacing it.
How Long Will the Repair Take? Once a replacement has been located and the plumber arrives, you should have hot water within a day.