Managing water—making sure there’s enough while keeping inundation at bay—is a central function of civilization. History is littered with impressive cultures that didn’t get it right, sealing their doom—from the Sumerians of ancient Mesopotamia to the Hohokam of the American Southwest.

It might seem that such lessons don’t apply to modern-day Americans, with our reservoirs and dams and water treatment plants. Certainly, our water-management systems are a marvel. They re-route rivers and make the desert bloom; they enable most of us to shower, flush, eat and drink while barely giving water a thought.

But, increasingly, these systems are failing to deliver. Just ask farmers in the western United States whose wells have run dry. Or fishermen whose livelihoods depend on coastal waters degraded by toxic algal blooms. Or ask refugees from recent floods in Puerto Rico or Texas.

The massive water systems that undergird our civilization involve a Faustian bargain: They allow us to control water to suit our needs, but in doing so they break the water cycle—the natural storage, cleansing and flow of water in healthy forests, rivers, soils, wetlands, and aquifers. Dams and reservoirs store water so we can use it when needed, but they also block fish migrations, destroy habitats, and trap sediment that replenishes deltas, which then leaves coastal residents vulnerable to storms and flooding. The draining of wetlands has opened up vast areas for crop production, but has left rivers and streams vulnerable to pollution that creates massive “dead zones” in coastal areas. Large-scale pumping of groundwater has led to a boom in agricultural production, but is now rapidly depleting aquifers that have stored water for thousands of years.

And our water challenges are only getting harder. The changing climate has thrown hydrologic cycles out of whack, making it difficult to ensure continuous supply and protect against floods. It’s little wonder that in 2016 the World Economic Forum declared water crises to be the top global threat to society over the next decade.

So what do we do? One lesson is key: We can’t keep doing what we’ve always done and expect a different result. More and more, water security is going to depend on working with nature, rather than against it.

Take the risks to our drinking water from wildfires and the land erosion and flooding that often follows them. Fire is essential to a healthy forest, but during much of the twentieth century, foresters snuffed fires out quickly to protect timber resources and nearby communities. As a result, many forests have become dense and overgrown, so when fires do break out they burn hotter and faster, especially in times of drought. On average, fires in the United States now consume twice as much area per year as three decades ago.

In the western US, where about two-thirds of the water supply comes from forested land, that trend spells trouble. In New Mexico, where the three biggest wildfires in the state’s recorded history have occurred since 2000, The Nature Conservancy spearheaded the Rio Grande Water Fund to restore the watershed and protect downstream drinking water supplies. To date, the fund has acquired $33.6 million in public and private contributions and restored some 70,000 acres of watershed lands.

Pioneering cities are also turning to nature to mitigate urban flooding. As metropolises from Houston, Texas, to Copenhagen, Denmark have seen, intense storms can overwhelm drainage systems, flood streets and homes, and rack up damages in the tens or hundreds of billions of dollars. With rising temperatures boosting storm intensity, urban flooding is bound to worsen.

In response, urban designers are mimicking nature and encouraging rain to do what it did before concrete and asphalt covered the landscape: Soak into the earth, replenish groundwater, and flow gradually back to rivers and streams. After experiencing two 100-year floods within six years, Copenhagen decided that instead of upgrading its drainage pipes and other “gray” infrastructure, it would strategically expand and redesign parks and other public spaces to capture and store more rainwater. Overall, the city’s $1.3 billion investment in such “green infrastructure” is estimated to cost half as much as a more conventional gray-infrastructure approach, while beautifying the city.

One of the biggest threats to water security is literally out of sight and out of mind: The depletion of groundwater. Farmers are draining aquifers in many of the world’s most productive food-producing regions, from the north plain of China to the Central Valley of California. Just as a bank account shrinks when withdrawals exceed deposits, so does a groundwater account. Today at least 10% of the world’s food depends on the unsustainable use of groundwater. In effect we are consuming tomorrow’s water to grow today’s food, which begs the question: What about tomorrow?

One answer comes from California, where a new law and severe drought have compelled innovation. Farmers are partnering with scientists and conservationists to recharge groundwater by inundating farm fields with wintertime floodwater, which then seeps through the soil to the aquifer below. Such groundwater recharge could slow depletion in the eastern San Joaquin Valley by 12-20%. Moreover, it could expand water storage for dramatically less than the cost of a proposed dam on the upper San Joaquin River.

Another neglected water source can be found right below our feet. The world’s soils can hold eight times more water than all rivers combined, yet agricultural practices deplete soils, causing that critical water reservoir to shrink. But this can be fixed by rebuilding soil health. By eliminating tillage and planting cover crops, farmers can build the soil’s carbon content and enable it to store more water. Even a one percentage-point increase in soil organic carbon can increase water-holding capacity by some 18,000 gallons per acre. Yet farmers plant cover crops on less than 3% of US farmland and practice conservation agriculture on only about seven percent of cropland worldwide.

Scaling up those practices could slow climate change by keeping more carbon in the soil, while curbing the nitrogen and phosphorus pollution that fuels algal growth and the creation of low-oxygen “dead zones” in lakes and estuaries around the world. Even a modest shift in taxpayer-funded farm subsidies could help spread these practices.

Perhaps the most visible sign of our broken water cycle is when rivers, diverted for agriculture, simply dry up. But here, too, innovative collaborations are getting rivers flowing again. In the Verde Valley of Arizona, conservationists and farmers have partnered to modernize nineteenth-century ditch systems, testing new approaches that enable irrigators to take only the water they need while leaving the rest for the river. In places, the Verde—a lifeline for birds and wildlife in the American Southwest—now has twice the summertime flow it had before.

The benefits of such smarter water management ripple out: farmers get an upgraded irrigation system; birds and wildlife get critical habitat; residents and visitors get more boating and recreational opportunities; and local businesses get more revenue. This is good business as well as good stewardship: In the Colorado River Basin, of which the Verde is a part, economic activity that generates some $25.6 billion a year depends on water staying in rivers rather than taking it out of them.

We can choose to fix our broken water cycle. To be sure, it will take more investment, incentives, and shifts in policy to transform our relationship with water from one of command-and-control to a working partnership. But the payoffs will be big and enduring, as this style of water management restores rather than degrades the natural world.

If the 20th century was the age of dams, diversions and depletion, the 21st can be the age of replenishment, the time when we apply our ingenuity to living in balance with nature and building resilience to the climatic changes under way. In so doing, we might avoid the fate of the Sumerians and Hohokam—and leave a healthy water cycle for future generations.