Need help understanding gas water heater
A - Expansion tank. This prevents the pressure increase due to heating water, from damaging the plumbing. The tank is filled with air, that is separated from the water by a bladder. When the water expands due to heating, water compresses the air absorbing the pressure.

B - Check valve (or back flow valve). This is designed to only allow water to flow in one direction.

C - Thermostatic mixing valve. This allows hot and cold water to mix, so the water is not too hot.  You can adjust this to make the water leaving the tank hotter or cooler. Note, the water can only be as hot as the water in the tank, so you'll also need to set the control knob to the proper temperature setting.

D - Ball valve (or quarter turn valve). Used to isolate expansion tank and turn off cold water to water heater.

E - Globe valve. Outlet to heating system.

F - Temperature and pressure relief valve (T&amp;P valve). This is designed to open if the water temperature, or pressure in the tank gets too high.

G - Hose bib. Not sure what it's used for here.

H - Globe valve. Inlet from heating system.

I - Ball valve. Used to turn the gas supply on/off.

J - Temperature control. Used to set the desired temperature for hot water. Adjusting this will change the temperature to which the heater heats the water to.

K - Drain.  This allows you to drain the tank.

L - Ball valve. Not sure what it's used for here.
Possibly shuts off cold water supply to heater, and/or other fixtures. If anything in this closet was a main shutoff, this would be it. Can't see where the plumbing goes, so can't tell if it only goes to the heater or splits to other fixtures.

M - Drip leg. This is used to catch any debris in the gas line, to prevent it from clogging the orifice.

N - Pilot view port. An opening where the pilot flame can be viewed from. Peek through here to see if the pilot is lit.

O - Burner cover. removing this would give you access to the main burner assembly.

It's not clear if any of these valves are the main shutoff.

You'll use a combination of the control knob and the thermostatic mixing valve, to set the temperature of the hot water delivered to the taps.