Answered by Sayyidi al-Ḥabīb `Umar bin Hafīẓ (may Allāh preserve him and benefit us by him).
How can someone be connected to the people of Allāh while living in a country where the majority of people are non-Muslim? How can he prevent himself from being deluded by their worldly possessions?
You must remember the reality. Allāh says of the disbelievers: Do not be impressed by their wealth and children;1 Do not strain your eyes in longing for things We have given for enjoyment to groups of them, the splendour of the life of this world, through which We test them; the provision of your Lord is better and more enduring.2 He also says: Let not the movement of the disbelievers in the land deceive you.3 You should see their worldly possessions as being completely insignificant things which cause them to lose out on their portion in the next world. You should feel sympathy for those who have been deceived by this contemptible world and you should wish that they are given insight. They are like children who are promised sweets and toys in exchange for being slaughtered. Not knowing the meaning of being slaughtered, they happily accept the sweets and toys. So look at these disbelievers with sympathy just as you would look at those poor children. Save them if you are able to. Do not be deceived as they have been deceived but wish that they be guided and have sympathy for them.
You should also focus on your attachment to the Master of the People of Allāh, Muḥammad and his Family and Companions and the friends of Allāh. This connection can be strengthened through reading their books and learning more about them on websites and other means so that you live with them, even if you are in a country where the majority of people are non-Muslim. The whole earth was created for the pious and not for the disbelievers, but Allah tests His slaves through the existence of disbelievers: Such days (of varying fortunes) we give to men in turns4 but the pious Muslims will eventually inherit the earth: We wrote in the Zabūr (Psalms), after the Message (given to Mūsā) that My pious slaves will inherit the earth5.
Wherever you are on the earth, even if most of the people living there are disbelievers, you are in a place to whose people Muḥammad (may Allah bless him and grant him peace) was sent. The land where you are is also a place of prayer and prostration (masjid) because the Messenger of Allah said: “The whole earth was made a place of prostration for me.” So whatever place in the earth you live in, you are in the masjid of your Prophet. This is why he said: “If the time for prayer comes and any member of my Ummah is in any place on the earth then he should pray in that place.” The whole earth is his masjid, which has been given to him by Allāh. If you are aware of this you will be connected to the people of Allāh.
2Ta Ha, 20:131
3 Al `Imran, 3:196
4 Al `Imrān, 3:140
5 Al-Anbiyā’, 21:105