Habit & Practice
Sīlabbata Sutta  (AN 3:79)

Then Ven. Ānanda went to the Blessed One and, on arrival, having bowed down to him, sat to one side. As he was sitting there, the Blessed One said to him, “Ānanda, every habit & practice, every life, every holy life that is followed as of essential worth: is every one of them fruitful?”

“Lord, that is not (to be answered) with a categorical answer.”

“In that case, Ānanda, give an analytical answer.”

“When—by following a life of habit & practice, a life, a holy life that is followed as of essential worth—one’s unskillful mental qualities increase while one’s skillful mental qualities decline: That sort of habit & practice, life, holy life that is followed as of essential worth is fruitless. But when—by following a life of habit & practice, a life, a holy life that is followed as of essential worth—one’s unskillful mental qualities decline while one’s skillful mental qualities increase: That sort of habit & practice, life, holy life that is followed as of essential worth is fruitful.”

That is what Ven. Ānanda said, and the Teacher approved. Then Ven. Ānanda, (realizing,) “The Teacher approves of me,” got up from his seat and, having bowed down to the Blessed One and circumambulating him, left.

Then not long after Ven. Ānanda had left, the Blessed One said to the monks, “Monks, Ānanda is still in training, but it would not be easy to find his equal in discernment.”

See also: DN 16; AN 3:68; AN 3:73; AN 4:42; AN 4:192; AN 10:94