One of the things that is widely regarded as a menace that might destroy civilization, or at least be enormously damaging, is a repeat of the "Carrington Event", the September 1859 geomagnetic storm. Back then there was hardly any electrical infrastructure, but there are stories of telegraph offices catching on fire and telegraph operators experiencing electric shocks. Now, it is said, with all our electronics, we'd be devastated. Even NASA has gotten into the act, forecasting trillions of dollars in damage from a repeat of such an event, and talking about it "disabling everything that plugs into a wall socket". But taking a hard look at the mechanism for such harm, really the danger is quite small.
The way that solar flares cause damage is by changing Earth's electromagnetic field. The flare in the sun releases charged particles, a "coronal mass ejection"; these travel outward until they hit the Earth's magnetic field (or, more likely, miss it entirely; but this is about the ones that do hit).
The Earth's magnetic field acts as something of a shield, repelling those particles, but as it does so it itself distorts. (Contrary to another apocalyptic myth, us ground-dwellers don't need that shielding; the atmosphere is a much better shield. It's only in low earth orbit that the magnetic field plays a big role in shielding from charged particle radiation.) The distortion in the field is what causes the danger: changes in magnetic field induce electrical currents, which can be damaging.