It depends on where the hazard was and who controlled it, and electrical cases often involve more than one responsible party. A property owner or landlord may be responsible for unsafe wiring in a building. A contractor may be responsible for faulty or unpermitted electrical work. A utility may be responsible for a dangerous power line, and a manufacturer for a defective product.
Each is established differently. A wiring hazard points to the owner and any contractor, and turns on the maintenance, permit, and inspection records. A power-line injury points to the utility, which is held to a high degree of care for its lines. A shock from a tool or appliance points to the manufacturer under product-liability principles.
Sorting this out depends on tracing exactly how the electricity reached you — a job for qualified experts examining the wiring, equipment, or line. Because that evidence can be repaired or replaced quickly, preserving it is one of the most important early steps, and it is what identifies every responsible party.