In the summer of 1995, a blistering heat wave settled over Chicago for three days. It killed 739 people, making it one of the most unexpectedly lethal disasters in modern American history. No statistical models of the heat wave predicted such a high death toll. Researchers in the American Journal of Public Health reported that their analysis “failed to detect relationships between the weather and mortality that would explain what happened.”

Just as mysterious as the number of fatalities was the way they were distributed across the city. Several of the most deadly areas were entirely black and disproportionately poor, but so were three of the least deadly. Adjacent areas that looked alike—like Englewood and Auburn Gresham, two hyper-­segregated black South Side neighborhoods with high poverty and crime—suffered vastly different effects.

Scientists who study urban breakdowns like this usually focus on hard-line infrastructure: electrical grids, transit networks, communications systems, water lines, and the like. And to be sure, Chicago’s aging infrastructure was woefully equipped for extreme heat. The power grid failed, leaving tens of thousands without air conditioning. Roads buckled and drawbridges locked, leading to gridlock and long ambulance response times. But those failures blanketed the entire city; they didn’t explain the patchwork death toll.

As a young sociologist who grew up in Chicago, I wanted to figure out why the heat wave killed who it did, where it did. So I set out to examine those pairs of “neighboring neighborhoods” that should have fared similarly but didn’t.

Englewood and Auburn Gresham may have looked similar on paper. But when I got to know them at street level, they came to look like different worlds. Englewood had been hemorrhaging for decades: first the employers; next the banks, groceries, and restaurants; finally the people. Residents described the area as “bombed out” and “abandoned.” Empty lots, boarded-­up houses, and broken, uneven sidewalks discouraged people from going outside, especially older people. During the heat wave, the residents of Englewood tended to hunker down in the safety of their homes—which became brick ovens. Englewood’s death rate was among the highest in the city.

Auburn Gresham, on the other hand, never lost its core institutions or its people. Stores, restaurants, community organizations, and churches animated its streets, and people hung out on the sidewalks. Older people there belonged to block clubs; residents assured me they knew who they had to keep tabs on during the heat wave. Auburn Gresham has long been regarded as one of the worst neighborhoods in Chicago; but its death rate, three per 100,000, was among the lowest in the heat wave—far lower, in fact, than many of the wealthy white neighborhoods across town.

Throughout the city, the variable that best explained the pattern of mortality during the Chicago heat wave was what people in my discipline call social infrastructure. Places with active commercial corridors, a variety of public spaces, local institutions, decent sidewalks, and community organizations fared well in the disaster. More socially barren places did not. Turns out neighborhood conditions that isolate people from each other on a good day can, on a really bad day, become lethal.

This is important, because climate change virtually guarantees that, in the next century, major cities all over the world will endure longer, more frequent, and more intense heat waves—along with frankenstorms, hurricanes, blizzards, and rising seas. And it’s inevitable that cities will take steps to fortify themselves against this future. The first instinct of urban leaders is often to harden their cities through engineering and infrastructure, much of which is indeed pretty vital. But research keeps reinforcing the lessons of Englewood and Auburn Gresham. Just as the temperature of a heat wave, the height of a storm surge, or the thickness of a levee, it’s the strength of a neighborhood that determines who lives and who dies in a disaster. Building against climate change can either support vibrant neighborhood conditions or undermine them. We know how to do both.

On October 2012, Superstorm Sandy smashed into New York. With 30-foot waves and 14-foot surges, the storm killed 24 people on Staten Island alone, ripped into the Jersey shore, and swamped lower Manhattan, one of the most densely populated zones in the US and home to thousands of public housing units, massive hospitals, major underground transit hubs, and several of the world’s largest corporations and financial institutions. When a major electrical substation in the East Village took on 4 feet of water, it exploded and snuffed out power for about 250,000 people below midtown. The outage left some of the most impoverished and some of the most affluent people in the city alike stranded on high floors of apartment buildings without water, electricity, or elevator service for nearly a week.

Like the Chicago heat wave, Sandy turned up evidence for the importance of social infrastructure. A study conducted by the University of Chicago’s National Opinion Research Center and the Associated Press showed that residents of neighborhoods with low levels of social cohesion—as measured by how much people said they trusted their neighbors—reported longer recovery times. Much of the initial response to the storm, however, focused on hard infrastructure. Prominent climate scientists and engineers called for vast, colossally expensive seawalls around big cities and on coast lines.

Officials have started to embrace the idea that social infrastructure is as essential to resilience as the built stuff.

Even in pure engineering terms, sea gates and seawalls can impart a false sense of security: They can accelerate coastal erosion, and if they fail, they can fail catastrophically. They also erode the quality of neighborhoods; when an oceanfront area turns into a fortress, people lose their connections to the water, and street life dries up. Who wants to live behind an enormous seawall? (Plus, storm surge has to go somewhere. Who wants to live where the wall ends?)

Luckily, officials have started to embrace the idea that social infrastructure is as essential to resilience as the hard stuff. In 2013, I started serving—at the behest of the White House—as the research director for an international competition called Rebuild by Design. The competition’s purpose was to allocate around $1 billion for major projects that would make the areas affected by Sandy more resilient against climate change and serve as pilots for the rest of the country. And a major requirement of the competition was that the projects should improve social infrastructure.

The six winning plans were announced in 2014. The highest-profile project, by architect ­Bjarke Ingels and the BIG Team along with One Architecture, essentially swathes lower Manhattan in a fortress of storm protection disguised as a smorgasbord of public space. The portion of the design proposed for the Lower East Side—which is, for now, the only funded part of the project—lines the waterfront with lushly planted berms that give pedestrians easier access to a slew of amenities on the water’s edge. The berms, which are 18.5 feet at their peak, absorb storm surges when necessary, but their everyday function is just as important: serving as parklands and recreational areas for people who live in an especially gray and unpleasant part of an especially gray city.

People are realizing that when the floods come or the heat wave settles, neighbors are the true first responders.

Another winning design—far more low-key and far less expensive—will subtly transform the coastline of Staten Island. Being directly exposed to the Atlantic, Staten absorbed waves so large during Sandy that they tore through communities blocks from the ocean, where no one expected a deluge. Working from computer models of waves and tidal flow, the landscape design firm Scape proposed a necklace of submerged reefs and oyster beds to rim the island’s Atlantic coast—partially man-made, partially natural structures that will promote sedimentation and absorb a tremendous amount of wave energy. But not all of it. Scape’s plan makes a point of acknowledging the inescapable fact that water is coming: Part of the project even launches a new school curriculum to teach kids on the island how their fate is linked to the fate of the oceans. It also links people in the area to each other, with plans for the construction of several cultural and educational hubs along the shore.

Neither project is under construction yet; the plan for lower Manhattan has received $335 million dollars in federal funding, and the Staten Island project has received $60 million. Both could get steered off course. Late-­stage budget cuts could reduce the Lower East Side’s verdant berms to an ugly and imposing seawall, exactly the kind of project that Rebuild by Design was supposed to reject. But so far the plans have wide support from local and federal offices, and other cities around the world have taken notice. People are realizing that when the floods come or the heat wave settles, neighbors are the true first responders. Next up, we’ll be able to focus on an even more urgent problem: reducing our greenhouse gas emissions before there’s no way to adapt.

Eric Klinenberg (@EricKlinenberg) is a professor of sociology and director of the Institute for Public Knowledge at New York University. He is a coauthor (with Aziz Ansari) of Modern Romance: An Investigation.

This article appears in our special November issue, guest-edited by President Barack Obama. Subscribe now.