What is halacha l’maseh when someone turns on by mistake the hot water handle on a sink on Shabbos?
This question depends on the hot water system that is in use.
If turning the faucet on or off causes a fire to the lit or put out, the hot water must remain on, and it would not be permitted to turn it off.
If the system is only a “dud shemesh” (relies on sun), or other boiler system, there remains a concern that turning off the faucet will cause boiling water to stay in the boiler, which will then cook the cold water that is entering into the boiler. On the other hand, it can be argued that the cold water is already there, and therefore closing the faucet is not doing an act of cooking.
For a dud shemesh (sun), one can be lenient to close the faucet. For an electric boiler, one should wait until the water coming out is not yad soledes bo, and than close the faucet.
Under extenuating cicrcumstanes, it might be possible to leave the water on, and allow somebody else, who is not aware of the Shabbos problem involved, to turn it off. This person’s action will be considered mis’asek, and would therefore not constitute a Shabbos prohibition.
There has been much debate on this question among poskim (e.g. must one inform people about an eiruv that came down; can somebody else be used to open a fridge door with a light that turns on — and so on), and one should only rely on this in extenuating circumstances.