Seen from a certain perspective, the last few months on planet Earth have been pretty unreservedly amazing. Nobody died from smallpox. Almost nobody contracted polio. Hospital operating theatres weren’t generally filled with the screams of patients undergoing surgery without anaesthetic, and no war claimed anything like the single-day death toll of the first hours of the Battle of the Somme, 100 years ago this week. Britain decided the question of European Union membership via democratic vote, not armed conflict, and women were entitled to participate – an astonishingly recent state of affairs. Though we don’t have all the figures yet, it’s likely that gun violence in America continued its long-term decline and that extreme poverty around the world continued to fall. Oh, and that working people on both sides of the Atlantic enjoyed unprecedented quantities of leisure time. Even if you don’t believe in the inevitability of human progress – maybe things really will get worse again in the future – it’s hard to deny that we’re having a good run.

But it hasn’t felt that way, of course. If you paid even scant attention to the headlines, or to social media, even before the shock of the Brexit vote, it felt peculiarly, unremittingly bad: the killings in Orlando, and the failure of gun control efforts in their wake; the return of English football hooliganism; the nastiness unleashed by the Brexit referendum; and then the horrifying killing of Jo Cox MP – all against the backdrop of the advance of both Donald Trump and the Zika virus. (Climate change didn’t go anywhere, either.) The news recently has had a mean, vindictive air about it, as if crafted by a comic-book supervillain solely to dispirit you personally: just when you think a week can’t get worse, you learn that your favourite Star Trek actor was killed in a freak accident in his driveway, or a two-year-old boy by an alligator at Disney World. All these incidents were appalling for those directly involved. For the rest of us, the apocalyptic feelings are somewhat harder to explain. We know, rationally, that people in every era have always believed that theirs was the worst in history – and that, by many yardsticks, things are better than ever. Yet the conviction that Everything Is Terrible remains. And now it is joined by the conviction that everything is uncertain, too, fuelling an escalating anxiety about the future.

Is it possible to remain happy, or even marginally optimistic, in such circumstances? Obviously, you could just cease consuming news entirely. That’s long been the advice of a certain breed of expert, for whom despair-inducing headlines are simply a distraction from what really matters. “Out of the approximately 10,000 news stories you have read in the last 12 months,” Rolf Dobelli, author of The Art Of Thinking Clearly, wrote in this newspaper, “name one that – because you consumed it – allowed you to make a better decision about a serious matter affecting your life, your career or your business. The point is: the consumption of news is irrelevant to you.”

But this is no use if you’re the kind of person for whom keeping abreast of the state of the world at large is one of the things that really matters. For us, checking out from the news isn’t an option – especially not in the face of sudden economic and political uncertainty, when it feels entirely possible that the news could have a very personal impact. The trouble is that, when it comes to getting an accurate grip on things, the modern media and the human brain are both strikingly poorly designed.

You’ve probably heard, in recent years, about the numerous cognitive biases that prevent us accurately assessing risk, so that we fear terrorist atrocities more than car accidents, for example, because it’s easier to call to mind vivid images of terrorism. But there’s another problem so fundamental, it tends to escape our notice: news, by definition, is about things that happen, rather than things that don’t. As the cognitive scientist Steven Pinker points out, you never see a news reporter speaking breathlessly live to camera from a foreign land because war hasn’t broken out there. And there will always be sufficient bad news to fill a half-hour bulletin, or a news website’s home page. Perfectly reasonably, most of us value stability and security in life, and fear sudden change. Yet stability isn’t news, which means that the headlines inevitably focus more on what we fear than on what we value. We’re subjected to an undifferentiated, unrelenting mishmash of Bad Events, in which one isolated incident of violent crime is accorded no less status than an ecological crisis that threatens to destroy the species. News, in the words of the French social theorist Pierre Bourdieu, becomes “a series of apparently absurd stories that all end up looking the same, endless parades of poverty-stricken countries, sequences of events that, having appeared with no explanation, will disappear with no solution – Zaire today, Bosnia yesterday, the Congo tomorrow.”

Widespread despair has tangible effects: it fuels the rise of Donald Trump and movements like Brexit

And things are even worse than that: we have evolved deep-seated instincts to treat news that need not affect us personally as if it does, argues Deirdre Barrett, a Harvard Medical School psychologist. In the distant human past – before mass media, among many other things – it made sense to respond with alarm to the news that a small child had been killed by an alligator: after all, it could only have been a small child from your own community, “so you might have to head out with a group of others to clear the alligators out of a nearby pond”. Meanwhile, a death toll of 50, as in Orlando, “might be the biggest thing that had happened in your locality for generations”. No wonder we feel overwhelmed: week after week, we learn about, and respond emotionally to, events of a kind that in prehistoric times might have occurred once every few years at most.

The dark cloud of negativity generated by unhappy news doesn’t remain confined to our feelings about national and international events, however. It spreads to distort our view of the rest of our lives, according to studies conducted by Professor Graham Davey, of the University of Sussex, and his colleagues. “Our research shows that when you show people negative news stories, as opposed to positive or neutral ones, they grow more anxious, and rate their own personal problems as significantly more problematic,” Davey says. “They catastrophise about them more. They make mountains out of molehills.”

And yet it’s negative news people seem to want: calls for more positive content in news programming cut little ice with Davey. “I vividly remember, when we were doing this research, putting together a tape of 15 minutes of positive news,” he recalls. “You know: people overcoming cancer, people winning lotteries, good news about the economy. And people were just absolutely bored by it.”

This points to something especially unfortunate about the psychology of anxiety, in the wake of an event such as the Brexit shock. We generally detest uncertainty – arguably more than we detest bad news – and our instinct is to respond by compulsively seeking more information, in an effort to assuage the anxiety. But since the future is intrinsically unknowable, that effort only drives home to us how little we can know – making the anxiety worse.

And there is another, subtler reason you might find yourself convinced that things are getting worse and worse, which is that our expectations outpace reality. That is, things do improve – but we raise our expectations for how much better they ought to be at a faster rate, creating the illusion that progress has gone into reverse.

Pinker, who makes this argument in his book The Better Angels Of Our Nature, highlights the example of bullying. Once upon a time, he told me, it was seen as “a part of boyhood: stamp it out and you’d raise a generation of pantywaists”. When Pinker was a child, he said, it would have been unthinkable for the US president to give a televised speech decrying the evils of bullying, as Barack Obama did in 2011. In principle, it’s good to pay attention to the real psychological harms it causes, except that, “because we now care about something that we formerly let slide, we think there’s a crisis in bullying”. Similarly, with the passing decades, we’ve also greatly expanded the circle of those whose suffering we take seriously in the first place, thereby increasing the number of stories with the capacity to distress us. To be upset by images of desperate Syrian refugees, you must first believe that Syrian refugees are as human as you are – a stance that wouldn’t have been a given in the Britain of centuries past. If the news makes you miserable, you can flatter yourself to this extent, at least: you’re miserable only because you care.

On the other hand, who really cares if you’re miserable? There’s an understandable argument that it is comically self-absorbed to worry about how the news makes you feel. Assuming you had no direct connections to those killed in Orlando, say, or to the family of Jo Cox, it is hardly one of the most salient aspects of either story that they caused you to feel depressed. It’s quite possible that the direct impact of Brexit on your family will be much less bad than you feared: there’s powerful psychological evidence that such shocks leave people’s underlying happiness levels largely unchanged in the long term. Perhaps we should all get over ourselves, especially if the long-term trends are mainly positive.

The catch, though, is that widespread despair at the state of the world has tangible effects: for one thing, it fuels the rise of politicians such as Donald Trump, and populist movements for sudden change such as the Brexit campaign. “With the drumbeat of bad news,” Pinker explains, “there’s an unhealthy conviction that we’re in a state of crisis, that things have never been worse, that they’re going to hell – and that opens the door to demagogic politicians. If things have ‘never been worse’, then our only hope is for the existing system to collapse, so that something better can rise from the rubble.”

In an ironic vicious circle, then, the despair that people feel – about developments including the rise of Trump – is the same kind of thing that fuels the rise of Trump. (The campaign to leave the European Union seemed similarly focused on sweeping away the status quo and hoping for the best.) The sense that the world is an increasingly terrible place, whether or not it really is, is itself a phenomenon with real effects that we can’t afford to ignore.

But if everything feels so hopeless, how are we supposed to motivate ourselves to do anything about it? This is a line of questioning familiar to Derrick Jensen, a writer and co-founder of the radical environmental movement Deep Green Resistance. “There’s this idea that if you know how bad things are, you have to go around feeling miserable all the time,” he says. “But I’m not miserable; I’m quite a happy person.” We tell ourselves we need to feel hopeful in order to take constructive action, yet in fact, Jensen argues, hope can be a barrier to action. In the environmental context, it allows people to cross their fingers and tell themselves that some technological innovation, or a visionary politician, will arrive at the last minute to stave off catastrophe. As Jensen puts it: “Hope is what keeps us chained to the system, the conglomerate of people and ideas and ideals that is causing the destruction of the Earth… Hope is a longing for a future condition over which you have no agency; it means you are essentially powerless.”

The solution to despair is to let yourself feel it – then take action: volunteer, make a donation, join a campaign

The principle might be extended beyond environmental concerns to every depressing aspect of the world today. Stop telling yourself that you need to feel upbeat, and it begins to seem less pointless to make some tiny effort to address one or two of those problems: to take on a small weekly volunteering role here; to make a modest donation to charity there. The solution to feeling so despairing about the news, in short, is to let yourself feel despairing – and take action, too. “One of the great things about everything being so fucked up,” Jensen likes to say when speaking to audiences, “is that no matter where you look, there’s a lot of work to be done.”

Don’t kid yourself that you will single-handedly eradicate nationwide or global problems; instead, define and pursue small-scale goals, like joining a campaign with some connection to the issues that trouble you the most. Focus on activities you enjoy: these will be much easier to sustain. And there is certainly some relief in attending to your own wellbeing. Exercise, sleep, time spent in nature, meditation and socialising are all proven paths to increased happiness; they’re cliches, but only because they really work – and it isn’t self-indulgent to make time for them.

Paradoxically, it’s through taking action, despite not feeling happy about the situation, that a deeper kind of happiness can arise. (That’s certainly the implication of research on the emotional benefits of volunteering, charitable giving, community involvement and political protest.) Jensen has written that people sometimes ask him why he doesn’t just kill himself, if things are as bad as he says. “The answer is that life is really, really good. I am a complex enough being that I can hold in my heart the understanding that we are really, really fucked, and at the same time that life is really, really good. I am full of rage, sorrow, joy, love, hate, despair, happiness, dissatisfaction, and a thousand other feelings. We are really fucked. Life is still really good.”