As 2019 came to an end, there appeared to be widespread optimism for 2020.

“It’s gonna be a fantastic year,” said President Trump.

Instead, the coronavirus pandemic turned 2020 into a year that will be remembered for the biggest health crisis in contemporary history. The coronavirus set the world back in many respects this year, leaving more than 1.6 million people dead, exacerbating global hunger crises, giving rise to conspiracy theories, and at some point disrupting the education of 9 in 10 students worldwide.

As the first mass vaccination campaigns are underway, 2021 may offer some relief. If it does, however, it will also be because of some of this year’s positive changes that were largely overshadowed by the pandemic.

Here are some glimmers of hope from 2020.

The coronavirus pandemic forced a reckoning with urban life. The share of the global population living in urban areas is set to expand significantly over the next three decades, from 55 percent to 68 percent by 2050, according to the United Nations.

There are numerous challenges associated with that shift, and 2020 put them on full display. Across Europe and Asia, millions spent weeks under lockdown and confined in their flats, as the virus spread particularly quickly in dense urban areas. Offices in prime locations were suddenly and eerily empty, and indoor bars, restaurants or museums had to be shuttered in countries around the world.

This has come at a heavy cost — domestic violence and mental health problems have surged.

But if there’s any silver lining to the shock of 2020, it may be that the pandemic is forcing residents, companies and authorities to rethink how urban life should look in the future.

Cities around the world vastly expanded bike lanes and pedestrian areas to allow for social distancing this year, curbing vehicle emissions and decreasing pollution, at least temporarily. More flexible work-from-home arrangements decreased commuter traffic, and some could be extended beyond the pandemic’s end.

As rents dropped and tourists stayed away, some local authorities seized on the developments to address long-standing problems. Portugal’s capital Lisbon launched a program to turn empty accommodations for tourists into apartments for poor families.

Germany, which has been faced with a declining population and rural flight, had long sought to make villages more attractive to young people. The pandemic appears to have done the trick. Demand for houses in rural Germany soared this year.

Even though the international community remains far from its environmental and climate goals, there were some major advances in 2020. The cost of producing solar energy continues to fall, according to several reports released this year, as market opportunities grow and the technology becomes more efficient. Denmark became the first major oil-producing nation to set itself a deadline to end extraction.

Despite that progress, 2020 wasn’t all positive. Yes, the pandemic did ground flights worldwide and temporarily decrease pollution and emissions, but the economic crises it triggered also diverted attention and some resources away from the threat of global warming.

There were both negative and positive developments on the biodiversity front in 2020. Some species went extinct or were added to the lists of at-risk animals, but others were rediscovered, including a 2-inch wide spider in Britain and two snail species in Australia.

Newly announced nature protection zones raised hopes that more animals could be brought back from the brink of extinction in coming years; in the Atlantic Ocean, the British overseas territory of Tristan da Cunha was declared a protected marine area this year, making it the world’s fourth-largest such zone.

2020 was a year of scientific breakthroughs. No human set foot on the moon this year, but we still found out a great deal about Earth’s constant companion in space. A pair of studies published in October confirmed there is water on the surface of the moon, meaning astronauts may be able to stay there for sustained periods someday.

China reached its own lunar milestone in December, when its Chang’e-5 capsule returned from the moon with 4.4 pounds of rock and soil for scientific research. It was the first such batch to arrive on Earth in more than four decades.

Around the world, scientists crossed physical and political frontiers this year to develop multiple coronavirus vaccines in record time. Mass vaccination campaigns are underway in the United States, Britain, China, Russia and other countries, far earlier than many experts had dared to hope.

We could see similar vaccine success stories in coming months or years. Earlier this month, for instance, a group of scientists announced in the Nature Medicine journal that an experimental universal flu vaccine had passed its first trial. If it is someday approved, it would make the current annual adjustments of flu vaccines obsolete.

The world made progress at combating other diseases, too. About half of new HIV infections last year were reported in women or girls. Protecting them against AIDS, the disease caused by HIV, may soon become a lot easier.

Women were taking a daily pill to keep from getting the virus, but scientists found a safe and easier alternative: an injection every two months.

In other health news, Africa was declared free of wild polio in August, meaning 9 in 10 people worldwide live in areas where the disease is thought to no longer exist.

“Ending wild polio virus in Africa is one of the greatest public health achievements of our time and provides powerful inspiration for all of us to finish the job of eradicating polio globally,” Director General Tedros Adhanom Ghebreyesus of the World Health Organization said in a statement earlier this year.

This month, Tedros offered another hopeful message, this time on the coronavirus. Amid the rollout of coronavirus vaccines, he said the world “can begin to dream about the end of the pandemic.”

Even though Tedros acknowledged that in some cases the pandemic had revealed the worst in humanity — including “self-interest, blame-shifting and divisions” — he emphasized the “inspiring acts of compassion and self-sacrifice, breathtaking feats of science and innovation, and heartwarming demonstrations of solidarity.”