Hakim bin Hizam said, "O Messenger of Allah ﷺ! I used to do good deeds in the Pre-Islamic period of Ignorance, e.g., keeping good relations with my Kith and kin, manumitting slaves and giving alms. Shall I receive a reward for all that?" Messenger of Allah ﷺ replied, "You embraced Islam with all the good deeds which you did in the past."
أَخْبَرَهُ أَنَّهُ قَالَ يَا رَسُولَ اللَّهِ أَرَأَيْتَ أُمُورًا كُنْتُ أَتَحَنَّثُ أَوْ أَتَحَنَّتُ بِهَا فِي الْجَاهِلِيَّةِ مِنْ صِلَةٍ وَعَتَاقَةٍ وَصَدَقَةٍ هَلْ لِي فِيهَا أَجْرٌ قَالَ حَكِيمٌ ؓ قَالَ رَسُولُ اللَّهِ ﷺ أَسْلَمْتَ عَلَى مَا سَلَفَ لَكَ مِنْ خَيْرٍ