I asked the Messenger of Allah ﷺ 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 discover."
سألت رسول الله ﷺ عن البر والإثم فقال: البر حسن الخلق، والإثم ما حاك في صدرك، وكرهت أن يطلع عليه الناس.
Muslim narrated it in "Righteousness and Ties of Kinship" (2553) through several routes from Muawiya bin Salih, from Abdul-Rahman bin Jubayr bin Nufayr, from his father, from Nawas bin Saman Ansari, and he mentioned it.