Learn how to take the initial steps to deal with dangerous situations in your home
First and foremost, if it is cause from a burst pipe, shut off the water main, then get the pipe(s) repaired. If the water is too high, turn off the electricity to the basement. The last thing you want to do is walk into electric water. Remove sections of damaged wall and insulation. Then begin the long process of drying the basement. Use your sump pump,
or use a wet-dry shop vac to remove the water. As soon as you can, add dehumidifiers and fans to prevent mold.
Water Heater Burst
First if it's electric, shut off the breaker to the water heater. If it's gas, turn off the valve near the water heater, then turn off the water main. If any items were damaged, call your insurance company because they may be covered.
Electrical Fire in Junction Box
Junction boxes are designed to contain flames to an extent, but not for long. Cut power to your entire house through the main box, which is usually outside. Use a class-C fire extinguisher to douse the flame. If you don't have one, dump a lot of baking soda on the flame. Contact your insurance company to see if damage is covered, and hire an electrician to diagnose what went wrong and to fix the problem.
Pilot Light Out
It's important to take precaution before attempting to relight the pilot light. You should close the nearest gas valve and allow the appliance to ventilate. particularly if you smell gas. If it persists, call your utility company and leave your home. If your home is clear, follow directions on the appliance to relight the pilot light, If it's on a water heater, you probably also need to replace the thermocouple.