The hadith you are asking about is most likely the one narrated by Abu Dharr, and documented in Sahih Muslim Hadith 375, Jami' at-Tirmidhi Hadith 2596, and in Musnad Ahmad Hadith 20517, among other books:
حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ نُمَيْرٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا الأَعْمَشُ، عَنِ الْمَعْرُورِ بْنِ سُوَيْدٍ، عَنْ أَبِي ذَرٍّ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِنِّي لأَعْلَمُ آخِرَ أَهْلِ الْجَنَّةِ دُخُولاً الْجَنَّةَ وَآخِرَ أَهْلِ النَّارِ خُرُوجًا مِنْهَا رَجُلٌ يُؤْتَى بِهِ يَوْمَ الْقِيَامَةِ فَيُقَالُ اعْرِضُوا عَلَيْهِ صِغَارَ ذُنُوبِهِ وَارْفَعُوا عَنْهُ كِبَارَهَا . فَتُعْرَضُ عَلَيْهِ صِغَارُ ذُنُوبِهِ فَيُقَالُ عَمِلْتَ يَوْمَ كَذَا وَكَذَا كَذَا وَكَذَا وَعَمِلْتَ يَوْمَ كَذَا وَكَذَا كَذَا وَكَذَا . فَيَقُولُ نَعَمْ . لاَ يَسْتَطِيعُ أَنْ يُنْكِرَ وَهُوَ مُشْفِقٌ مِنْ كِبَارِ ذُنُوبِهِ أَنْ تُعْرَضَ عَلَيْهِ . فَيُقَالُ لَهُ فَإِنَّ لَكَ مَكَانَ كُلِّ سَيِّئَةٍ حَسَنَةً . فَيَقُولُ رَبِّ قَدْ عَمِلْتُ أَشْيَاءَ لاَ أَرَاهَا هَا هُنَا " . فَلَقَدْ رَأَيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم ضَحِكَ حَتَّى بَدَتْ نَوَاجِذُهُ .
Abu Dharr reported that Allah's Messenger (ﷺ) said: I know the last of the inhabitants of Paradise to enter it and the last of the inhabitants of Hell to come out of it. He is a man who would be brought on the Day of Resurrection and it will be said: Present his minor sins to him, and withhold from him his serious sins. Then the minor sins would be placed before him, and it would be said: On such and such a day you did so and so and on such and such a day you did so and so. He would say: Yes. It will not be possible for him to deny, while he would be afraid lest serious sins should be presented before him. It would be said to him: In place of every evil deed you will have a good deed. He will say: My Lord! I have done things I do not see here. I indeed saw the Messenger of Allah laugh till his front teeth were exposed.
— Sahih Muslim, Book 1, Hadith 375