Sunan Ibn Majah, Book 37, Hadith 4363 (In-Book)

It was narrated that ‘Abdullah said: “A man said to the Messenger of Allah: ‘How can I know when I have done well and when I have done something bad?’ The Prophet said: ‘If you hear your neighbors saying that you have done well, then you have done well, and if you hear them saying that you have done something bad, then you have done something bad.’”

حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، أَنْبَأَنَا مَعْمَرٌ، عَنْ مَنْصُورٍ، عَنْ أَبِي وَائِلٍ، عَنْ عَبْدِ اللَّهِ، قَالَ قَالَ رَجُلٌ لِرَسُولِ اللَّهِ ـ صلى الله عليه وسلم ـ ‏:‏ كَيْفَ لِي أَنْ أَعْلَمَ إِذَا أَحْسَنْتُ وَإِذَا أَسَأْتُ قَالَ النَّبِيُّ ـ صلى الله عليه وسلم ـ ‏:‏ ‏ "‏ إِذَا سَمِعْتَ جِيرَانَكَ يَقُولُونَ قَدْ أَحْسَنْتَ فَقَدْ أَحْسَنْتَ وَإِذَا سَمِعْتَهُمْ يَقُولُونَ ‏:‏ قَدْ أَسَأْتَ فَقَدْ أَسَأْتَ ‏" ‏ ‏.‏

sunnah.com