The Messenger of Allah ﷺ said, "I and the one who cares for an orphan will be like these two in Paradise," and he pointed with his index and middle fingers, parting them slightly.
حدثنا سعيد بن منصور حدثنا يعقوب بن عبد الرحمن عن أبي حازم
قال رسول الله ﷺ أنا وكافل اليتيم كهاتين في الجنة وأشار بالسبابة والوسطى وفرق بينهما قليلا
Its chain of transmission is sahih. It is found in Bukhari, in the Book of Divorce, 9/439, no. 5304, Fath al-Bari, in the chapter on lian. He mentioned it in the chapter on lian because in most cases of lian there is a child involved, and that child would certainly grow up an orphan without a father. It is also found in Muslim, 2/591, in the Book of Asceticism, and in Tirmidhi, 4/321, no. 1918, in the Book of Righteousness, where he said, hasan sahih. It is also found in Malik, 2/948, in the chapter on poetry.