A CO₂ fire extinguisher is the best option because it is non-conductive and does not damage electrical equipment.