I asked the Prophet ﷺ about righteousness and sin. He said, "Righteousness is good character, and sin is what stirs unease in your heart and what you would hate for people to find out about."
حدثنا عبد الرحمن بن مهدي عن معاوية يعني ابن صالح عن عبد الرحمن بن جبير عن أبيه أن النواس بن سمعان الأنصارى قال وكذا قال
سألت النبي ﷺ عن البر والإثم فقال البر حسن الخلق والإثم ما حاك في صدرك وكرهت أن يطلع الناس عليه
Its isnad is sahih. The hadith was narrated by Muslim, 4/1980, no. 2553, in the Book of Righteousness, chapter on the tafsir of righteousness and sin, and by Tirmidhi, 4/597, no. 2389, in the Book of Asceticism, chapter on what has been said concerning righteousness and sin, where he said, hasan sahih, and by Hakim, 2/14, and Dhahabi agreed with him.