A man said to the Messenger of Allah ﷺ, "How can I know when I have done well and when I have done wrong?"The Prophet ﷺ replied, "When you hear your neighbors say that you have done well, then you have done well, and when you hear them say that you have done wrong, then you have done wrong."
قال رجل لرسول الله ﷺ: كيف لي أن أعلم إذا أحسنت وإذا أسأت؟ قال النبي ﷺ: إذا سمعت جيرانك يقولون: أن قد أحسنت فقد أحسنت، وإذا سمعتهم يقولون: قد أسأت، فقد أسأت.
Ibn Majah (4223), Ahmad (3808), and Ibn Hibban (525, 526) all narrated it through Abdul-Razzaq (and it is in his Musannaf, 19749), who said, Mamar narrated to us, from Mansur, from Abu Waail, from Abdullah bin Masud, and he mentioned it. Its isnad is sahih.