Earth gleams in space like a beacon, bathed in light from a yellow dwarf star that burns just 93 million miles away. Here on the surface, however, our planet can seem surprisingly dark sometimes, and not just in the literal dimness of night.

That gloom takes many forms, from the initial shock of misfortune to the insidious despair that creeps in later. It can be triggered by minor setbacks or major tragedies, and may be harbored by a single person or shared by millions.

A collective dread has recently emerged in the United States, for example, due to the country's 2016 presidential election. After an ugly, caustic campaign, the events of Nov. 8 have already cast long shadows across the U.S. and around the globe, threatening to darken U.S. and world politics for at least four years.

The 2016 election was indeed bizarre, and its outcome may yet prove catastrophic. We can only wonder how it will affect international alliances and economic stability, not to mention the fragile efforts to curb human-induced climate change.

Still, this is no time for pessimism. New leaders aren't necessarily as bad as they seem in the wake of a campaign, so it may be premature to panic before they've taken office. But even if the political, economic and ecological ramifications live up to our worst fears, pessimism remains a dangerous path.

Disappointment without hope can become despair. If you feel hopeless about the future in coming days, months or years, keep these points in mind:

Losing hope means losing power.

"We must accept finite disappointment, but we must never lose infinite hope."
— Martin Luther King Jr.

Obama at Yosemite President Obama speaks at Yosemite National Park in June 2016. (Photo: Brendan Smialowski/Getty Images)

Humans are prone to something called the optimism bias, which compels us to underestimate the odds of personal misfortune and overestimate our likelihood of good luck. That can be dangerous when taken too far, but it may also be a valuable adaptation for our species. The point of hope isn't to arbitrarily soothe ourselves, but to avoid the slippery slope from despair to apathy. Adaptive hope is a self-fulfilling prophecy, helping us stay engaged enough to keep working for progress, and focused enough to capitalize on opportunities when they arise.

"Believing that a goal is within reach," neuroscientist Tali Sharot has written, "motivates us to act in a way that will help us attain it."

As people think optimistically, a brain region known as the rostral anterior cingulated cortex (RACC) becomes more activated, according to fMRI scans, as does the right amygdala. That suggests the RACC might work with our amygdala to limit negative emotional responses, thus encouraging us not to give up on ambitious goals.

The optimism bias generally works at an individual level, making us optimistic about our own personal futures, but not necessarily about the future of our city, country or society. The same principles apply, though, and history has shown that when we do muster collective hope, it can provide a foundation for the changes we seek. From the 1960s Civil Rights Movement to the 2008 (and 2012) election of President Obama, the U.S. has already seen what the audacity of hope can do.

"To the young people who got into politics for the first time, and may be disappointed by the results, I just want you to know, you have to stay encouraged," Obama said in a speech Nov. 9. "Don't get cynical. Don't ever think you can't make a difference."

Setbacks seem bigger up close.

night sky over over Mammoth Lakes, California Distant stars shine over mountains at Mammoth Lakes, Calif. (Photo: John Lemieux/Flickr)

Misfortune usually feels worse in the immediate aftermath, before time adds perspective. Not always, of course — an injury might deteriorate with age, or a new politician might grow increasingly reckless with power. But while it's wise to prepare for potential crises, there's little benefit in letting foresight generate fear.

For one thing, it's unwise to assume the worst while a scary situation is still unfolding. Despite the ominous outlook for climate change after the U.S. election — which could jeopardize the Paris Agreement and the Clean Power Plan — candidates sometimes behave differently in office than on the campaign trail. And even if the U.S. does abandon the climate leadership role it adopted under Obama, as many expect, things may not be quite as dire as they seem. The renewable energy industry is already booming, for example, a trend that's likely to continue. China or Europe could also help fill the leadership void in climate talks, and while that might not be good for the U.S., preserving the Paris Agreement would be good for humanity overall.

But time doesn't just help us make peace with negative events — it can also help us move past them. Life and politics tend to be cyclical, so if something bad happens, the best response is often a mix of patience and persistence. There will be new relationships, new jobs, new opportunities and new elections. In the meantime, spending time in nature can be a restorative way to deal with grief.

It can always get worse.

yellow flower at Grand Canyon A flower grows at Lipan Point, on the South Rim of the Grand Canyon. (Photo: Moyan Brenn/Flickr)

Bad luck can be a blessing if it reminds us how lucky we've been — and thus how much we still have to lose. The world might seem dark after a bad divorce or a petulant political campaign, but that shouldn't obscure what good remains. If there's enough light left to see things you care about, then it can still get a lot darker.

Maintaining a broad perspective on life is a valuable skill for anyone, but as NASA astronaut Edgar Mitchell explained in 1971, it's especially important for politicians. And aside from the passage of time, Mitchell noted, not much can offer a person perspective quite like seeing the Earth from space:

"You develop an instant global consciousness, a people orientation, an intense dissatisfaction with the state of the world, and a compulsion to do something about it," Mitchell said. "From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, ‘Look at that, you son of a bitch'."

LRO view of Earth from the moon A view of Earthrise from the moon, as captured by NASA's Lunar Reconnaissance Orbiter. (Photo: NASA)

Russell McLendon ( @russmclendon ) writes about humans and other wildlife.