Sunan an-Nasa'i, Volume 3, Book 21, Hadith 1933 (DarusSalam) ⓘ
It was narrated that Abu Qatadah said: "We were sitting with the Messenger of Allah when a funeral appeared. The Messenger of Allah said: 'He is relieved and others are relieved of him. When the believer dies he is relieved of the calamities, hardships and troubles of this world, and when the evildoer dies, the people, the land, the trees and the animals are relieved of him."'
أَخْبَرَنَا مُحَمَّدُ بْنُ وَهْبِ بْنِ أَبِي كَرِيمَةَ الْحَرَّانِيُّ، حَدَّثَنَا مُحَمَّدُ بْنُ سَلَمَةَ، - وَهُوَ الْحَرَّانِيُّ - عَنْ أَبِي عَبْدِ الرَّحِيمِ، حَدَّثَنِي زَيْدٌ، عَنْ وَهْبِ بْنِ كَيْسَانَ، عَنْ مَعْبَدِ بْنِ كَعْبٍ، عَنْ أَبِي قَتَادَةَ، قَالَ كُنَّا جُلُوسًا عِنْدَ رَسُولِ اللَّهِ صلى الله عليه وسلم إِذْ طَلَعَتْ جَنَازَةٌ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " مُسْتَرِيحٌ وَمُسْتَرَاحٌ مِنْهُ الْمُؤْمِنُ يَمُوتُ فَيَسْتَرِيحُ مِنْ أَوْصَابِ الدُّنْيَا وَنَصَبِهَا وَأَذَاهَا وَالْفَاجِرُ يَمُوتُ فَيَسْتَرِيحُ مِنْهُ الْعِبَادُ وَالْبِلاَدُ وَالشَّجَرُ وَالدَّوَابُّ " .
also referenced under: Hadith 1931 (Reference) & Book 21, Hadith 115 (In-Book)