Fish live in just about every aquatic environment on earth, from freezing Artic seas to warm tropical swamps. Captive fish are usually split into two groups, cold water (goldfish, koi carp etc) and tropical (both freshwater and marine species that inhabit the warmer waters of the world).
Typical cold water species live in unheated conditions, usually an outdoor pool, or unheated aquarium.
Tropical species on the other hand prefer more constant conditions, typically around 23-28 degrees centigrade (73-82 degrees Faranheit). This is most easily achieved by the use of a submersible aquarium heater. These heaters are electric, and as a precaution hould be switched off whenever touching the water. Shocks from such equipment are rare, but it is always good to be cautious!
Most heaters have built in thermostats, which allow the heater to turn off and on as required. In rare instances these can stick, and overheat the tank. It is therefore wise to use a stick on thermometer strip to keep track of the exact temperature. Occasionally heaters will fail, and many aquarists with big tanks use two heaters, so that should one fail, the other can still keep the fish warm.
Aquarium heaters are rated in watts, and as a general rule, you should have 2 watts of power for each gallon of water. For example a 50 Watt heater is adequate to heat a 25 gallon tank.