Recent weeks have seen Scotland's highest profile Muslim politicians come forward to make public the racism and Islamophobia they have faced. This is not an easy thing to do, and no matter your party political view, it is crucial that each story is met with understanding.

The truth is, much of what goes on is kept private. Perhaps it was an isolated comment from a colleague. Maybe the barrage of trolls on Twitter are not worth making a big deal of. But these issues need to be raised. Thanks to Anas Sarwar, Humza Yousaf and Tasmina Ahmed-Sheikh a discussion has been opened about Islamophobia in Scotland.

While it can be uncomfortable to relay personal experiences, they can shine a light on daily reality. A few years ago I flew to America for a holiday. I had a sense of trepidation entering the United States, having already been questioned by anti-terror police once before at Prestwick airport. After presenting my passport at Newark airport I was asked to step aside and was taken on a lift down to an interrogation room flanked by two police officers armed with machine guns.

The experience was more than a little disconcerting. Your rights don't seem to stand up to much in this kind of situation. After being questioned on my travel history – specifically if I had ever been to the Middle East or North Africa – I was told I could leave. "Welcome to America" the officer said without a hint of irony. The feeling of being profiled on the basis of your name or appearance is difficult process to go through.

It is complacent to talk about Islamophobia in isolation - the problem needs to be understood in a broader context. It plays a central role in the development of the radical right and serves a propaganda function in relation to foreign policy. It is peddled in the right-wing press while being used to justify attacks on civil liberties that in the end limit the freedom of all.

There was outrage when Trump declared during his Presidential campaign that he would seek a ban on Muslims entering the US. But this kind of policy has its roots in the "war on terror" which fostered division and the demonisation of Muslims. The broad brush strokes with which George W Bush painted a picture of a "50 years war" against an "arc of extremism" opened the space for a wide ranging anti-Muslim offensive. The "war on terror" integrated itself in draconian ways into the state domestically. And of course it advanced the Iraq war in which US-run prisons administered humiliating forms of torture that sent shock waves across the Muslim world.

Tony Blair, unable to take any responsibility for the disastrous wars he mobilised for, made a statement at the start of 2016 which wouldn't be out of place at a Trump rally. He asserted that "many millions" of Muslims hold a viewpoint that is "fundamentally incompatible with the modern world". This is where the logic of the 'war on terror' ends up.

Such narratives have merely been taken up and popularised by the social media accounts, personalities and parties of the far-right for whom Islamophobia is key recruiting sergeant. They talk of an 'Islamic takeover' and decry the presence of mosques. Even the elected London mayor represents a fifth column. They talk of "no-go zones" and use Islamophobia as a gateway into their ideology. They are well prepared to take advantage of people's fear in the immediate aftermath of a terror attack.

If this wasn't enough, the Muslim community comes under yet more pressure from the state itself. The Prevent programme, for example, is nominally set up to 'counter extremism'. In reality it encourages mass surveillance of the Muslim community by the public. As the 'Students Not Suspects' campaign point out: "Prevent has limited the window for dissent against domestic and foreign policy, been used to physically shut down spaces for organising and educating against oppression, turned students into suspects and educators into informants, and opened politically active and vocal individuals – especially Muslims – up to deeply damaging accusations and smears of 'extremism'."

It is little wonder that a study of Muslim Scots carried out by St Andrews and Newcastle universities showed that there was concern about being seen to be 'overly politicised'. It concludes: “Islamophobia and negative representation in the media is damaging their [Muslims] confidence to play a much more visible role in society."

If we are to confront Islamophobia, we must identify its roots and present alternatives. That means developing a new foreign policy to replace the "war on terror", and mounting a defence of civil liberties. And, to successfully defeat the far-right, we have to 'drain the swamp' of Islamophobia.

With the debate now open in Scotland we can lead the way by educating civil society, unions and politicians about the architecture of Islamophobia. We will need to go well beyond the comfort zone of proclaiming opposition to Trump. And it is not simply a matter of 'calling out' individuals. Islamophobia is a defining question of our times. Far from being a free-floating phenomenon – it is the organising principle driving a new era of reactionary politics. Much depends on how we meet this challenge.

Jonathon Shafi is a Scottish-Asian writer and director of the think tank New Foreign Policy