A solar flare of geological-record proportions, combined with a coronal mass ejection beyond any previously recorded, result in an EMP-like destruction of any electronics more delicate than a heavy electric motor, along with power failures and broad destruction from voltage spikes on power lines (up to millions of volts on long runs of high tension wire).
End result: everything more modern than a steam engine fails, and almost everyone who understood technology well enough to rebuild dies in the resulting chaos (food riots, epidemics, outright wars fought with conventional rifles and grenades that don't require electronics). In the end, fewer than 10% of the population is left alive, most of them on the edge of starvation. Even if their number includes people with the necessary knowledge and skills (and it likely would) the infrastructure is gone. It would take, at a minimum, centuries to build back up from dark ages (Roman Empire technology, if not pre-Roman) -- and the easily mined metals, easily drilled petroleum, etc. are also gone, along with the alternative energy sources (taken down by the solar EMP equivalent).
The fall would give virtually no warning -- the flare radiation takes the same time to reach Earth as the light that announces it, even though the CME particles that would keep things off long enough for the fall to become permanent take a couple days -- and shutdown would take hours, at most, for the effects to spread globally. Starvation, of course, takes weeks to really kill, but food riots are never more than a few days away (food stores typically have 24-72 hours of stock on hand -- which will vanish in an hour or two when looting starts).
It's remotely possible that people in a geographically favored locale might restore basic electrical power from hydroelectric generation and remaining wiring -- but they'd have nothing more sophisticated than incandescent lights and heavy, factory-style machinery, with no computers to run them. No printing press, as type metal to make one work has long been scrapped as toxic waste. No communications, because records of how pre-electronic phone exchanges worked are lost and the equipment for plug-board switching exists only in museums in the (grossly unsafe) cities.
This would be the starting point for the rebuild.