The writer, New York City mayor from 2002 to 2013, is the founder of Bloomberg Philanthropies and co-author of the book “Climate of Hope.”

“We need to keep it open so we have jobs.” Those are the words of a retired miner, explaining why the local mining operation is so important to his community. But he wasn’t talking about a coal mine in Appalachia. He was referring to a local asbestos mine — in Russia.

Through the 1970s, the United States was one of the world’s top producers of asbestos, which is a set of naturally occurring silicate minerals. As evidence mounted that exposure to asbestos fibers can be deadly, the federal government began limiting its use in consumer and commercial products. Demand for asbestos declined, legal liabilities soared, and the last U.S. asbestos mineclosed in 2002. Those jobs have gone overseas, to places such as Russia, China and Kazakhstan, where asbestos mining and production face few restrictions. Yet there has been no political clamor to put American asbestos miners back to work.

Now consider the coal industry. Pollution from coal-fired power plants kills about 7,500 Americans each year, according to the Clean Air Task Force, an environmental group. That number is down from 13,000 in 2010 for a simple reason: Two hundred and fifty-one of the nation’s 523 coal plants have since closed or are being phased out. This decline has been driven by a combination of two powerful forces: cheaper alternative fuels (such as natural gas and renewable energy) and rising consumer demand for cleaner energy that won’t pollute the air and water that communities breathe and drink.

But that decline in power plants isn’t the main culprit behind the decline in coal mining jobs. There were 220,000 jobs in the industry in 1980. In the decades that followed, as production increased, jobs declined, because technology and automation made it possible to extract more coal with far fewer miners. When production peaked in 2008 — before coal plants started closing en masse — only 82,000 jobs remained.

There are now about 65,000 jobs left. That number will continue to fall in the years ahead, as technological advancements continue to displace workers and as cleaner and cheaper forms of energy continue to displace the industry itself.

The fact is, putting coal miners back to work is no more possible from a business standpoint than putting telegraph operators back to work taking Morse code or putting Eastman Kodak employees back to work manufacturing film rolls.

Politicians who ignore these market realities and make promises to coal communities they can’t keep are engaged in something worse than a con. They are telling those communities, in effect: The best hope they have, and that their children have, is to be trapped in a dying industry that will poison them.

I don’t believe that’s true. We can save lives by ending coal production — just as we did with asbestos production — while also helping communities make the transition to 21st-century jobs. Doing that will not be easy, nor can it be accomplished quickly — that’s why politicians pander with empty promises. But it is the right thing to do both for coal communities and the entire country. It’s time for local, state and federal leaders to face up to the task.

Those outside of government can play a role, too. While making “From the Ashes,” a new film about coal’s impact on our health, climate and economy, my foundation featured several local organizations in Appalachia and the West that are working to create good jobs outside of mining. At least one of those groups is facing the possibility of losing its federal funding. To prevent that from happening, we have decided to step in to provide what the group stands to lose — and by matchinga portion of donations from the public. We’ll also support efforts in Western states aimed at spurring job growth in professions outside of mining.

The transformation of the energy market away from coal and toward cleaner energy is bringing extraordinary health and economic benefits to the nation — there are now about 500,000 Americans working in the solar and wind industries. But those jobs are dispersed around the country, and coal regions face concentrated job losses that can harm families and depress local economies. We shouldn’t let government off the hook for helping them — but we shouldn’t sit back and wait for Washington to act, either.