(13) باب مَنْ وَصَلَ وَصَلَهُ اللَّهُ
Narrated Abu Huraira:
The Prophet (ﷺ) said, "Allah created the creations, and when He finished from His creations, Ar-Rahm i.e., womb said, "(O Allah) at this place I seek refuge with You from all those who sever me (i.e. sever the ties of Kith and kin). Allah said, 'Yes, won't you be pleased that I will keep good relations with the one who will keep good relations with you, and I will sever the relation with the one who will sever the relations with you.' It said, 'Yes, O my Lord.' Allah said, 'Then that is for you ' " Allah's Messenger (ﷺ) added. "Read (in the Qur'an) if you wish, the Statement of Allah: 'Would you then, if you were given the authority, do mischief in the land and sever your ties of kinship?' (47.22)
Reference: Sahih al-Bukhari 5987
In-book reference: Book 78, Hadith 18
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 8, Book 73, Hadith 16