TACKLING loneliness was a top priority for the late MP Jo Cox, so it was grimly fitting that this topic was under discussion at Holyrood on Tuesday night, less than 24 hours before her former workplace came under attack.

In times of sudden, violent tragedy we take comfort from images of people rushing to help, co-operating with strangers and uniting in a spirit of common humanity. Amid fear and confusion, all normal social conventions are temporarily abandoned.

But this effect is fleeting. In the aftermath of Wednesday’s events, an earnest tweeter shared a picture of a tube carriage and observed that Londoners were “staring into their phones with sadness and fear”. Some wag retweeted it, noting the poster must be new to the UK capital if he thought this an unusual state of affairs.

In modern Britain, talking to strangers is not the done thing. Increasingly, talking to one’s next-door neighbour is not the done thing either. Indeed, even talking to one’s friends is being replaced by texting and instant messaging. Meanwhile, more and more people are reporting loneliness – in recent research for the British Red Cross, nearly one in five said they felt lonely “always” or “often”.

Mention loneliness and most people think of elderly folk at home alone, too frail to get out and with limited access to technology. They tend not to think of young mums, retirees and empty-nesters, or people who have recently separated from long-term partners. The Red Cross research identified these as neglected groups, along with the bereaved and those of all ages with health and mobility problems. It highlighted the cycle of loneliness that can result when an individual becomes cut off: the isolation has the effect of reducing self-esteem, which then makes it difficult to maintain existing relationships and even harder to establish new ones.

So what can be done to alleviate this complex problem? The MSPs who spoke during Tuesday’s debate highlighted the need for local and national governments to recognise and respond to the harm of loneliness, emphasising that it’s not only bad for mental health but for physical health too. Most praised the work of third-sector organisations providing everything from befriending schemes and mother-and-toddler groups to lifeline transport services and men’s sheds.

But most also touched on the broader social context in which people are experiencing loneliness. Tory MSP Alison Harris told the chamber she didn’t like to ponder how it would feel to lose a life partner, and rather poignantly referred to situations where, after death or separation, “friends of the couple turn out to be only friends with one of the partners” – contributing to the vicious cycle of lost connections, reduced self-esteem, and further withdrawal.

We cannot stop people from divorcing or dying. We wouldn’t want to stop them retiring, or leaving the family home when they reach adulthood. But perhaps we should give more consideration both to how we live our lives when the going is good, and how we support our own friends and family members in dealing with change.

Anyone who dedicates their whole life to a job will naturally struggle upon retirement, particularly if their social network is limited to the workplace. But instead of calling on employers to help with this transition, shouldn’t we be promoting a healthier work/life balance? In the same way, shouldn’t we encourage those in co-dependent relationships to maintain other friendships, hobbies and interests? The notion of “you and me against the world” might have romantic appeal, but the grim reality is that one day it will become a solo mission. “You and me and our wider social network against the world” may not sound quite as snappy, but it offers much better odds.

The process of identifying a lonely person and trying to help them rejoin society is difficult, expensive and potentially extremely patronising. No-one ever wants to be in a position where they need to be a “client” of a “service” to make pals. But it’s easy to see why a widowed or divorced person may quite suddenly feel they no longer fit in, or have no-one to confide in, or don’t really know who they are anymore. They might feel they are a burden to others who still have an intact family unit and don’t want to be reminded that one day they, too, might end up alone.

When the cross-party Jo Cox Commission on Loneliness was launched at the end of January, badges bearing the message “happy to chat” were handed out on the Tube, and Cox’s sister said she hoped loneliness could be eradicated “one conversation at a time”. But wouldn’t it be better if we could stop those around us from becoming lonely in the first place?

There will always be a role for befriending services for the most marginalised, but if ordinary folk were to focus on prevention rather than cure, what might that look like? It might be as simple as reaching out to a friend whose life circumstances have changed, to assure them you’re never too busy to make time for a chat. It might be a wee thing like a supportive text, a hand-written note or a loan of a novel you think they’ll enjoy. It might mean helping to catch the pieces when someone’s world starts falling apart. To let them know, above all, that they are not alone.