THE historian Alistair Moffat has been thinking a lot recently about life and death, especially now that he has, by his own admission, got through a fair chunk of the first and is getting closer to the second. He’s also come up with some personal rules on how to be better at both. Secular rules. You don’t have to believe in God to use them.

But here’s a curious thing: to find his private lessons for life and death, Moffat, an atheist, had to go on a kind of religious journey, a peregrination following the route used by the Scottish hermit and monk Saint Cuthbert. Cuthbert, the man of God, made his journey in the 7th century from Dunbar in East Lothian to Lindisfarne in Northumberland. Alistair Moffat, the man of no God, followed the same route in the 21st century. It changed both of them.

Both journeys are outlined in Moffat’s new book, To The Island of Tides, which is a kind of travelogue but also a search for answers to some of the questions that were bothering Moffat in his late 60s after many years as a writer, historian and a director of the Edinburgh Fringe. The journey to Lindisfarne also came about because of a terrible event in his life: the death of his first grandchild Hannah, who was stillborn three years ago.

“Hannah’s death was the biggest impulse to do it, although it wasn’t the only one,” says Moffat. “It was a black, black time and I could find nothing in it that was good or could be positive. Had I believed in God, I would have been extremely angry with him. It was because it was a life that was never lived.”

He says the image of Hannah’s funeral and her little wicker coffin will stay with him for the rest of his life, but the terrible event also made him think about how we approach the death of others as well as our own. Hannah is buried on Moffat’s farm in the Borders, and he says he thinks about her frequently. In a way, this is the first lesson of his journey: we should keep the dead close to us if we can.

The second lesson comes straight from Saint Cuthbert. Death would have loomed much larger for him and his fellow monks for the simple reason that life was shorter in the 7th century and could end abruptly and painfully. But 14 centuries later, many of us live longer, and death is hospitalised and more controlled and so we’re able to push it aside more, or just not talk about it. Moffat doesn’t think that is necessarily healthy.

“That was one of the values of doing this journey,” he says. “It forced me to think about a lot of things you push to the side and that was worthwhile. There are people who really do believe they can live to be 120 with the right vitamins. And because there’s this anti-ageing culture, and because medicine is so good, we don’t consider death because it takes so long to come. That’s the great paradox – the longer we live, the less we consider it.”

One of Moffat’s solutions to this is to plan your own funeral and he tells me he’s already started doing his own. He will be buried on the farm, next to Hannah, and he has also chosen the music that will be played. “I love Donnie Munro ‘s voice,” he says, “and there’s a lovely anthem that he sings called The Highest Apple which is about education really so I’d like that. And then there’s the great Ishbel MacAskill. Those two would do for a start.”

Moffat also believes that, at any point in your life but especially as you get closer to death, it’s important to work out how you want to live the rest of it. He tells me about a moment during his visit to Northumberland when he found himself, a little awkwardly, talking to Saint Cuthbert out loud and making promises about how he would try to change. He would begin to spend more time alone, not working or writing but thinking. He would also try to honestly confront past wrongs and regrets and accommodate them and try to be less bitter about the moments in life where he felt he’d been let down or betrayed. He says he needed to let the bad moments and memories go for the sake of enjoying the rest of his life.

“When it gets to the evening, you want to enjoy the rest of the day,” he says. “You don’t want to poison it by going over and over old hurts and bruises – it’s a waste of time. You can’t just dismiss them because they’re important and so you’ve got to find a way of coping with them.

“I wasn’t forgiving myself or anything as tidy as that but what I was doing was trying to put them in their proper place – further back in my mind and put further forward all the good positive things. If I’ve got ten years of decent health, touch wood, I’m not going to enjoy them if I’m spending half the time going over and over old hurts.”

The second promise Moffat made to Saint Cuthbert – that he would spend more time alone and, even more importantly, spend more time in silence – was just as important. His instinct, says Moffat, is to be gregarious and to talk but one of the things he came to realise on the journey to Northumberland was that closing his mouth more could help to open his consciousness, and start an internal dialogue he needed to have.

“I grew up on a council estate in the 50s and early 60s,” he says, “and there was a sense of community and everyone blethered to everyone else all the time. It had an egalitarian feel to it – nobody was any better off than anybody else and you helped each other out. People got involved in each other’s lives so to shut up was a real act of will. But you’ve got to shut up. You’ve got to be quiet.”

That lesson came directly from Cuthbert, who would have spent a lot of time on his own and in silence, and Moffat doesn’t think it is so unusual for atheists to learn from religious people in this way. Yes, we live in an increasingly secular society, he says, but Christian ethics endure and atheists and agnostics can still draw comfort or inspiration from religious places, like Lindisfarne, which was a centre of Christianity in the 7th century, or devout people like Cuthbert. In fact, Moffat believes that in politically chaotic times like ours, peaceful places like Lindisfarne take on even more significance.

And that’s not the end of it because another quasi-religious idea emerged from Moffat’s love of a special place like Lindisfarne. He tells me about the changes he has seen on his farm in the Borders and his suspicion that climate change is to blame. The hedgehogs have disappeared. So have the house martins. And, slowly but surely, marsh grass is taking over everything.

The answer, he says, is a Second Creation of a secular kind – humans will need to return to having respect for the rest of creation, as Cuthbert did, they will need to live simpler and less-consuming lives and they will need to stop treating the environment as merely a background or a context for human dominance. “Never mind Brexit or Trump,” says Moffat. “The biggest issue is that our planet is dying.”

If you think that, in the end, all this talk of dying makes Moffat sound like a downbeat sort of person, you’d be wrong – he’s chatty, pleasant and open and has always enjoyed having a big family and doing his big, high-profile big jobs, such as running the Fringe in his twenties and now running the Borders Book Festival.

One thing he hasn’t ever been able to shake while doing all of this, though, is a slight sense of imposter syndrome as the boy from a council estate – in journalism and television and a series of establishment roles, he has always been surrounded by people who have occasionally made him feel like an outsider.

But he's never let it get to him, he says, and he has never networked, and never will. His friends are his friends because he likes them, not because he wants something from them. In a way, this was something else that Moffat learned on Lindisfarne (Saint Cuthbert followed his own course too) and it’s another of the historian's little rules for life. It’s also part of a settlement, a deal with himself that will help him, when the time comes, to face his death.

To The Island of Tides by Alistair Moffat is published by Canongate at £20