The first thing to do, in the event of a power supply failure is - don't panic!
The tropical aquarium, even one of modest proportions, can be regarded as a heat store and won't suddenly freeze solid in a matter of minutes.
In the average setting of a normally furnished (and probably centrally heated) room the heater in the aquarium won't have been over-worked anyway, once the water had reached its selected temperature. It would take several hours for the water temperature to fall to lethal limits for the fish.
Now to sensible actions.
Further heat loss should be prevented at all costs - even before seeking to restore the power supply failure. (This presumes that the power failure is ongoing and not just a blown fuse).
Wrap the aquarium is some form of heat-insulating material - bubble-wrap, blankets or even several layers of newspapers. Now you can turn your attention to providing alternative heating (again, presuming a lengthy power shortage).
If you have an another means of heating - gas, for instance - then the best thing to do is fill several containers with hot water and stand or float them in the aquarium to maintain the temperature. You may have to repeat this operation at regular intervals to maintain the temperature.
NOTE: You should drain out some of the tank water to allow for water displacement by the containers, otherwise the tank will overflow.
Do not simply drain off some water and replace with heated water as this will alter the water conditions in the tank; the fish may be stressed by sudden exposure to 'raw' water being introduced. In marine tanks, adding water will certainly upset the Specific Gravity reading.
The opposite situation
Should the aquarium overheat, then you can reduce the temperature by floating ice cubes (contained in a sealed bag) in the water. Alternatively (or additionally), open the hood, turn up the aeration (or add some) and direct a fan to blow air across the water surface to add more cooling.
© FBAS AR/RCM Aquarium Management Care Sheet No 12 1/2