Depending on how bad the fire is initially, go to where your circuit breakers are housed and turn off the sections giving power to the affected area. The safest course of action is to disable power to the entire house, just in case the fire spreads. Much like with an oil fire, don’t use water to put it out. This will only make it worse. Use a special class C fire extinguisher, which is designed especially for situations like this. Use the extinguisher to put out any sparks that are showing on the malfunctioning appliance or unit. Remember, returning to the scene of the fire is only a valid option if you are confident that it’s not yet out of hand and won’t pose a risk to your safety.