Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him)
How can someone be connected to the people of Allah 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. Allah says of the disbelievers: Do not be impressed by their wealth and children (9:55); 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 (20:131). He also says: Let not the movement of the disbelievers in the land deceive you (3:196). You should see their worldly possessions as being completely insignificant things that 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 Allah, Muhammad and his Family and Companions and the friends of Allah. 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 turns (3:140) but the pious Muslims will eventually inherit the earth: We wrote in the Zabur (Psalms), after the Message (given to Musa) that My pious slaves will inherit the earth (21:105).
Wherever you are on the earth, even if most of the people living there are disbelievers, you are in a place to whose people Muhammad (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 Allah. If you are aware of this you will be connected to the people of Allah.