I arrive at the nondescript office in San Jose where I am to meet Khaled Hosseini in the middle of a once-in-a-lifetime solar eclipse. The Californian light has a strange quality, silvery and laden.

When Hosseini opens the door, I barely get out a formal greeting before he interrupts. “Have you seen it?” he asks. He is tall and dashing, and carries himself with a Clooney-esque, grizzled charm.

“C’mon,” he says, handing me a pair of specially made sunglasses and darting off towards the back of the building. He points to a spot in the rear courtyard. “Right there,” he says. “That’s the best spot.”

I put on the sunglasses and look up at the sky. The sun is a perfect circle, cut neatly into a crescent by the dark round shadow of the moon. It is like nothing I have ever seen. I had tried and failed to watch the eclipse from my car as I drove to the meeting, but what Hosseini shows me is many orders of magnitude more breathtaking. After a moment I take off the glasses and look in his direction. He is beaming proudly, as though seeing the sun through my eyes.

When we start the interview, the novelist is just as attentive. He peppers me with questions about who I am and where I am from long before I get a chance to turn on the recorder. There is a sense that his travels throughout the world as a goodwill ambassador for the United Nations High Commissioner for Refugees (UNHCR), a post he has held for more than a decade, most recently in Uganda, have given him an increased appreciation for his life and whoever is in front of him. His primary contribution has been to speak with those fleeing fighting in countries such as Afghanistan, Chad, Iraq, Jordan and Uganda and to write their stories down, much as he did for his characters Amir and Hassan in his bestselling 2003 novel The Kite Runner.

Another writer faced with such unexpected success (The Kite Runner sold more than 7m copies in the US alone) might have retreated from the world. But Hosseini, himself a fugitive from war, has instead committed himself to quietly documenting the lives of more recent refugees, in the hope his writing will spur the world to take notice of their plight.

“Everybody knows there’s a war,” he tells me, “but once you feel what that war means, I think for most people it’s unfathomable not to act on it, even if it’s in a small way. It becomes that much harder to simply dismiss or move past. It prickles your consciousness.”

In a sense, Hosseini’s entire mission as a writer has been to prickle the consciousness of the western world. His father was an Afghan diplomat working in Paris when Russia invaded his home country in 1979. His family sought asylum in the US and Hosseini arrived at 15 years old, with only a limited grasp of English. He went on to attend medical school and began practising as a doctor in California. While still working as a physician, he began writing The Kite Runner,hoping to share what life in his homeland had been like. “I expected the book to resonate with people who were interested in the region, who maybe were interested in Afghanistan specifically,” he remembers. “But the degree to which it caught on … it did take me by surprise quite a bit.”

The Kite Runner spent 110 weeks on the New York Times bestseller list. Hosseini followed it up with A Thousand Splendid Suns in 2007 and together, his first two books sold 38m worldwide. But before writing his third and most recent novel, 2013’s And the Mountains Echoed, he began his work with UNHCR, an experience that he says changed him as a writer. “I think my third book was a quieter book. It dealt less with archetypes, [is] a little bit more complex,” he says. “Displacement, refugees, these things are still very much with me … I think I live now, not preoccupied, but engaged in my mind with bigger issues than I was when I writing The Kite Runner.”

A paramilitary police officer carries the body of Alan Kurdi, after the boat carrying him to the Greek island of Kos capsized, near the Turkish resort of Bodrum on 2 September 2015. His mother and five-year-old brother also died, but Alan’s father Abdullah, survived. Photograph: AP

“The way I thought about it, when I saw the photo, was all the unseen work that goes into the raising of a child,” says Hosseini. “All the private worries, the private anxieties, the making sure they have this, the making sure that they eat properly, that they’re vaccinated, that their clothes fit them, they’re not uncomfortable, that they sleep well, that they get their vitamins. We worry and fret over their wellbeing, and to have done all that work, and see the person that you poured all that love and all that passion and all that work into, and to see that body lying face down on the beach …” He trails off.

In the virtual reality project, Sea Prayer is transformed into an immersive painting by artist Liz Edwards, using Tilt Brush technology, to appear with flourishes and splatters of paint in time with the narration, read by Bafta-winning actor Adeel Akhtar. Alongside the visuals is a haunting score composed by musician David Coulter, working with the the Kronos Quartet, an ensemble who donated their time to score the piece.

Reading – and watching – Sea Prayer, I am struck not only by the beauty but by the futility it represents; the father pleads with the sea, but the sea either cannot or will not answer his prayers. I ask Hosseini if he remains optimistic, even after spending much of the last decade immersed in the darkest aspects of humanity.

“If I don’t have faith or confidence that by doing the work that we do we make [a] difference, then I would live in a really cynical world that I don’t find to be a productive way of living,” he says. “There, the game is really over. At least this way there’s a hope that somebody will connect with these stories.”

Hosseini’s hope, as tempered as it may be, is impressive. It is one thing to feel optimism when seated in a comfortable home in a country not quite at war, but quite another to travel and sit with people who have barely escaped unspeakable darkness, and still feel that a difference, no matter how small, must and can be made.

• This article was amended on 5 September 2017 because an earlier version to the characters in the Kite Runner as “Amir and Hazara”. The characters are Amir and Hassan, Hassan being of the Hazara ethnic group.