The easiest way to defend against an EMP is with a Faraday cage. Long story short, a Faraday cage is a contiguous conductive structure that completely surrounds an object. No electromagnetic radiation can get in, and none can get out. A Faraday cage doesn’t have to be solid metal to work. Backyard hobbyists often knock them together from copper mesh.
Most modern buildings, especially those built in areas prone to earthquakes or other natural disasters, incorporate steel rebar in their construction. This too affords a measure of protection, though it’s a bit like the difference between taking shelter from a sudden storm under an awning and taking shelter under a tree.
An easy way to test whether or not a building offers protection is to measure your level of cell signal inside and out. If there’s a noticeable drop in service once you go inside, the building has a high enough metal content to provide some protection from an EMP.
Cars with an all metal construction also provide a degree of protection. The large glass windows are a vulnerability, so don’t count on any cell phones or laptops left inside being safe, but the computers are usually stored in less vulnerable areas. Newer high end cars tend to incorporate high levels of carbon fiber or fiberglass in their body construction, so don’t hold your breath about being able to cruise around town in your Ferrari after the apocalypse.
It’s also worth noting that turning your devices off might also be an effective countermeasure, though getting warning about an incoming EMP is easier said than done. NORAD is pretty good about tracking incoming attacks, so you might get several minute’s worth of warning before one hits, but in that case, you’ll probably have more important things on your mind than unplugging your Playstation and wrapping it in aluminum foil.
The takeaway from all of this is that yes, a large scale EMP attack can cause a great deal of damage, but it’s not the end of the world. So, whenever a politician or talking head gets on the news and starts bleating on about how we’re all doomed, I want you to remember one simple phrase: EMPs don’t work like that.