The late, great Imam of Masjid as-Saggaf, Habib Muhammad bin Alawi Al-Aydarus (also known more fondly as Habib Sa’ad), mentions in his book, The Book of Intentions, the following seven intentions to place in one’s heart when visiting a brother or sister (in Islam):
- To intend to visit someone for his or her sanctity, eminence and status e.g. as an alim, as an elderly figure.
It is narrated that two brothers (in Islam) met and one said to the other, “Where have you come from?” He replied, “I have returned from the Haj and from making ziarah of the Prophet ﷺ. And you? Where have you come from?” The first brother answered, “From visiting a brother, to greet him for the sake of Allah.” The second brother (who made Haj) said to the other, “Would you give me half of your rewards and I’ll give you half of mine?” He (the one who visited a brother in Islam for the sake of Allah) lowered his head for a while then they both heard a hatif (disembodied voice) saying, “Visiting a brother in Allah is better than 100 Hajs except the Haj of Islam (the Obligatory Haj).”
- To intend to bring affection and harmony to him or her.
Allah says in Surah Al-Anfal:
وَأَلَّفَ بَيۡنَ قُلُوبِہِمۡۚ لَوۡ أَنفَقۡتَ مَا فِى ٱلۡأَرۡضِ جَمِيعً۬ا مَّآ أَلَّفۡتَ بَيۡنَ قُلُوبِهِمۡ وَلَـٰڪِنَّ ٱللَّهَ أَلَّفَ بَيۡنَہُمۡۚ إِنَّهُ ۥ عَزِيزٌ حَكِيمٌ۬
Meaning: And He has united their (i.e. believers’) hearts. If you had spent all that is in the earth, you could not have united their hearts, but Allâh has united them. Certainly He is All-Mighty, All-Wise. (8: 63)
Ibnu Mas’ud said, “This verse was revealed about those who love each other for the sake of Allah.” It is said that four things affirm your love for your brother: visiting one another, giving salams, shaking hands  and giving gifts.
- To intend to fulfill the sunnah of our Messenger ﷺ.
The Prophet ﷺ said, “O Abu Razin, aren’t you aware that when a man leaves his house to visit his brother for Allah’s sake, he is followed by 70,000 malaikah who make doa for him saying, “O our Lord, he has joined ties so join him with you!”?”
- To intend to have one’s sins expiated by fulfilling the hadith of the Messenger ﷺ, “When a brother (in Islam) visits his brother (in Islam) for the sake of Allah, and they shake hands and they smile at each other, their sins will fall off from them.”
- To intend to earn his or her blessings and gaze. Al-Fudhayl said, “Looking upon a brother in Allah in yearning and love is an act of worship.”
- To intend to receive his or her advice and doa (especially if the person you are visiting is a pious, God-conscious Muslim) .
- To intend to receive the love of Allah.
It is mentioned in a hadith that an angel (who came in the form of a man) once asked a man, “Where are you going?” and the man answered “I seek a brother of mine in this village.” So the angel asked him, “Is there any kinship between you or are you returning a favour?” and the man replied, “No. I am visiting him for the sake of Allah.” So the angel said to the man, “I am a Messenger from Allah and I am here to convey to you that He loves you as you have loved your brother for His sake.”