Stay relaxed and act as quickly as possible. You must immediately find your circuit breaker box. Once you have found the breaker, you must turn it off immediately. Try to get off the water so you will not risk being shocked by electric currents. But if your heater functions with gas, then, you will have to turn off the gas valve. Then, you must find the valve of the line of cold water. This valve may be found on top of your heater. Either it is marked as cold or blue in coloring. Once you have found the right valve, switch it off as well.