We human beings exist by being first in one moment, then in another, and then in another, until we reach our end. Time circumscribes the human phase of the atoms that make up our body. Our atoms once belonged to stars. Soon they will belong to the earth, or the seas, or the sky. We recognise that with time every human being will cease being, will only have been. And so we seek to resist time. We rebel against it. We are drawn like lovers to the unreachable past, to imagined memories, to nostalgia.

As I travel the world on my phone and computer and by foot and aircraft, it seems to me that nostalgia is a terribly potent force at this moment of history. Nostalgia manifests itself in so much of our political rhetoric. Islamic State and al-Qaida call for a return to the imagined glories of the early years of Islam. The Brexit campaign was fought with a rallying cry of taking back control from Brussels, promising a return to the imagined glories of pre-EU Britain. Donald Trump emerged victorious in the US election wearing a baseball cap emblazoned with the words “Make America Great Again”, words chanted by his supporters, envisioning a return to the imagined greatness of an America recently victorious in the second world war. In China and India, too, leaders seek a return to imagined past greatnesses, usurped by foreign invaders, colonisers and barbarians. All of these movements are, at heart, projects of restoration.

Envisioning a return to the imagined greatness of post-second world war America … Donald Trump. Photograph: Matt York/AP

Nostalgia manifests itself in our entertainment and artistic culture as well. The most viewed films of our time revolve around protagonists created a generation, or multiple generations, ago: superheroes, super villains, super secret agents, super space adventurers, super ironic symbols of super sexy pasts. And on television, where we are told great storytelling happens, much of what we see in popular and acclaimed shows comes situated in a past where characters can still plausibly be almost all white. I loved Mad Men and my wife loved Downton Abbey; we and many of our friends in Pakistan loved these and countless other shows so much that it has only intermittently struck us that they are imaginative vehicles hurtling back and away from our vastly non-all-white present-day planet. Even in Game of Thrones, the laws of physics and biology and consistency allow for fire-breathing dragons and undead warriors and interminable winters, but not for non-white people living in most of Westeros. The laws of race, it seems, are immutable even there.

Nor is the realm of technology resistant to nostalgia. Quite the opposite. On our dominant social networks we are pulled out of the present moment to constantly shape and examine and interact with carefully curated pasts. Through technology the past is made real to us in a way that it never has been before. I can see myself five seconds ago, and my first girlfriend five hours ago, and my first child five months ago, and my first dog five years ago, and my first smile in my mother’s arms five decades ago, and I can sift endlessly through these archives of past moments, commingle them with present choices and likes and filters, and craft new past-present hybrids, dancing across time, sometimes alone, sometimes with others, commenting, watching, playing, mesmerising myself as the world outside my screen goes unnoticed for increasingly long interludes. Those of us who thought Jorge Luis Borges was a pioneer of magical realism were mistaken; he was a pioneer of science fiction.

‘Much on TV is set in a past where characters can still plausibly be all white’ … Mad Men. Photograph: AMC/Lionsgate

Why are we so strongly attracted to nostalgia today? In part, I think, because the pace of change is accelerating. Despite our close relationship with technology, at this point in our evolution human beings are still animals, and animals struggle to adapt to change that occurs too rapidly. Given enough time, polar bears might migrate off the Arctic ice, evolve darker coats, find a different diet and thrive in a new, warmer climate. But if the ice on which they depend disappears in a few decades, they are likely to die. Our adaptive capacity is far greater, but we too experience change as stress. The world my grandparents grew up in would not have been that strange to their grandparents. Yes, the few cars on the roads would have been striking, as would the few houses lit by electricity. But the world my children are growing up in is far more disconcerting to my parents: a world of wirelessly connected digital devices, roboticised factories, genetically modified crops and daily flights from Lahore to Rio de Janeiro, to Sydney.

We are growing terrified of the future. Soon we might merge with our technology, reprogramming our cells and adding computers to our neural circuitry, becoming in the process ever more adaptive to change, and less stressed by it – but for now this prospect offers scant reassurance. Instead we see upheaval and uncertainty ahead. At the same time, the tools we have evolved to deal with upheaval and uncertainty, and with the inevitability of our own mortality, are being undermined. Families are being scattered across the globe. Religion is being repurposed for political gain and consequently emptied of spirituality. Clan and tribe and nation are being challenged by hybridity.

Does a grandchild living half a world away offer a grandparent the same likelihood of experiencing a love that transcends the self as does a grandchild living next door? Does a religious discourse focused on conflicts with other religions, and indeed on conflicts among subgroupings within that religion, offer the same likelihood of solace in the face of the temporariness of existence? Does a tribe interbreeding with other tribes offer the same possibility of an eternal identity into which one’s individual identity can be subsumed? We are becoming unmoored just as the currents around us are growing swifter.

Our reaction is predictable. The kind of futures we would like to inhabit seem unlikely to occur. The futures that we suspect are likely to occur, meanwhile, fill us with anxiety. And so we are left stranded: unstable in the present, being dragged from the past, resistant to the future. We become profoundly angry, vulnerable to the dangerous calls of charlatans and bigots and xenophobes. We become depressed. And in our depression we become more dangerous, too. A suicide bomber is someone killing themself, after all.

❦

When I was nine years old, my family moved back from California, where we had gone so my father could complete his PhD, to Lahore, where I had been born but had not visited since I was three. The jarringly total nature of this shift is perhaps difficult to imagine today. In 1980 there were no email accounts or social media or text messages. The post was slow and unreliable. International phone calls had to be booked in advance and cost a fortune. I never saw, or heard from, a single one of my friends again.

I had left one world and entered another. People looked different. The smells were different. Food tasted different. The languages were different, not just Urdu, which I had to relearn from scratch, but also English, where a Lahori form now presented itself as standard, and functioned often in sharp contrast to Californian. There was only one television channel, broadcast for only part of the day, with only one or two shows a week that I felt any desire to watch. And so I turned to books.

‘The importance of clan, family, history, honour and formality were a useful education to this California boy finding his way in Pakistan’ … The Lord of the Rings. Photograph: Sportsphoto Ltd/Allstar

In particular I turned to fantasy. I read The Chronicles of Narnia by CS Lewis. The idea of children passing through a wardrobe into a strange and magical land seemed entirely plausible to me. I read the Middle-earth novels of JRR Tolkien. The importance (and intricate navigation) of clan, family, history, honour and formality, even as practised by hobbits or elves, must have been a useful education to this until recently California boy now finding his way in Pakistan.

I had always been a daydreamer, and I whiled away long hot summers in Lahore playing make-believe, by myself, or with my cousins. But I also began to do something strange. I became fascinated by atlases, with their gorgeous multicoloured maps, their different icons for settlements of different population sizes, their snaking, undulating contour lines. I became fascinated by almanacs, with their brief descriptions of countries: a snapshot of history, demographics, chief exports, climatic conditions. And I began to make countries of my own.

I would mark out their borders in pencil on my maps, sometimes claiming this peninsula and that island for my new nation state, sometimes that mountain range or valley. I would write out their histories in a few paragraphs, what goods originated there, what languages people spoke. At first, these countries were scattered archipelagoes of discontinuous territory, part of the San Francisco Bay Area, for example, joined in nationhood with Lahore and its surrounding districts.

Later, though, I began to create countries on non-existent islands that I would conjure up from the sea. These places were geographically unified but demographically varied. Lahoris and San Franciscans were often among the inhabitants, but equally often there were people from other places, from China, Kenya, Brazil or France. These islands sat in the middle of the Indian Ocean, or in the Pacific, but if one could travel to them and see their people, they might well look like the people of New York or London today.

‘I had left one world and entered another’ … Mohsin Hamid in Lahore. Photograph: Ed Kashi/VII/Corbis

The worlds I was creating, and the stories in them, were a starting point for what would become my present profession. I began my first novel 25 years ago, when I was not yet 22. I have been writing novels for more than half my lifetime. But I had already, before I began, been depending on storytelling to navigate an otherwise baffling world for more than half my lifetime before that.

Stories helped me unite parts of my existence that might otherwise have seemed irrevocably split by geography and time. And stories helped me find a future in which I, such a mongrel, could be comfortable. I do not inhabit an island in the Indian Ocean with a population as diverse as that of London, nor a nation composed of bits of Pakistan and California. But I have over the last three decades lived first in America, then in Britain, then in Pakistan. And I do spend many weeks in America and Britain each year, and many weeks in other places, and correspond on most days with friends and colleagues on multiple continents. My life might be peculiar, but it suits me. It flows directly from those first worlds I imagined as a child. Without my stories, without the journey and direction implicit in them, I might never have found it. Perhaps I would not even have looked.

❦

Since well before the dawn of history, human beings have gathered together around flickering campfires to tell and listen to tales. We still do, even if the campfires are now more often glowing screens – in cinemas, on television sets, or in our hands. There are a great many reasons for this: fictional narratives offer us so many things. But in our present moment it is worth remembering one reason in particular: storytelling offers an antidote to nostalgia. By imagining, we create the potential for what might be. Religions are composed of stories precisely because of this potency. Stories have the power to liberate us from the tyranny of what was and is.

Those of us who write fiction are free to create what we wish. We are the startups of the storytelling world

We are all creators of fictions, and we all have a role to play in imagining our way out of the nostalgic traps strewn around us. But there are special opportunities open to those of us who create fiction for a living, and above all to those of us who are writers, because we are freer to create what we wish, without requiring funding for our projects, as a film-maker might. We are the startups of the storytelling world, the crazy solo inventors in the R&D department of humanity’s narrative imagination.

We should be glad for these opportunities. The future is too important to be left to professional politicians. And it is too important to be left to technologists either. Other imaginations from other human perspectives must stake competing claims. Radical, politically engaged fiction is required. This fiction need not focus on dystopias or utopias, though some of it probably will. Rather it needs to peer with all the madness and insight and unexpectedness and wisdom we can muster into where we might desirably go, as individuals, families, societies, cultures, nations, earthlings, organisms. This does not require setting fiction in the future. But it does require a radical political engagement with the future.

Take back control? Make America great again? Restore the caliphate? We can do better than these. Storytellers, now is the time to try.

• Mohsin Hamid will discuss his new book, Exit West, at a Guardian Live event in London on Thursday. For details and to book tickets visit theguardian.com/guardianlive. Exit West is published on 2 March by Hamish Hamilton. To order a copy for £12.79 (RRP £14.99) go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.