The Buddha describes two types of bhikkhus based on how they deal with thoughts of sensuality, ill-will, and harming while walking, standing, sitting, and lying down, and which one is capable of reaching the highest awakening.
Toleration of harmful thoughts
"Bhikkhus, if while a bhikkhu is walking, a thought of sensuality, a thought of ill-will or a thought of harming arises, and if that bhikkhu tolerates it, does not abandon it, dispel it, eliminate it, or bring it to an end, even while walking, such a bhikkhu is called 'unmotivated, without concern, constantly slack, and lacking in endurance.'
Bhikkhus, if while a bhikkhu is standing, a thought of sensuality, a thought of ill-will or a thought of harming arises, and if that bhikkhu tolerates it, does not abandon it, dispel it, eliminate it, or bring it to an end, even while standing, such a bhikkhu is called 'unmotivated, without concern, constantly slack, and lacking in endurance.'
Similarly, bhikkhus, if while a bhikkhu is sitting, a thought of sensuality, a thought of ill-will or a thought of harming arises, and if that bhikkhu tolerates it, does not abandon it, dispel it, eliminate it, or bring it to an end, even while sitting, such a bhikkhu is called 'unmotivated, without concern, constantly slack, and lacking in endurance.'
Similarly, bhikkhus, if while a bhikkhu is lying down but awake, a thought of sensuality, a thought of ill-will or a thought of harming arises, and if that bhikkhu tolerates it, does not abandon it, dispel it, eliminate it, or bring it to an end, even while lying down, such a bhikkhu is called 'unmotivated, without concern, constantly slack, and lacking in endurance.'
Abandonment of harmful thoughts
Bhikkhus, if while a bhikkhu is walking, a thought of sensuality, a thought of ill-will, or a thought of harming arises, and if that bhikkhu does not tolerate it but abandons it, dispels it, eliminates it, and brings it to an end, even while walking, such a bhikkhu is called 'with continuous effort, with concern, always with aroused energy, and determined.'
Bhikkhus, if while a bhikkhu is standing, a thought of sensuality, a thought of ill-will, or a thought of harming arises, and if that bhikkhu does not tolerate it but abandons it, dispels it, eliminates it, and brings it to an end, even while standing, such a bhikkhu is called 'with continuous effort, with concern, always with aroused energy, and determined.'
Similarly, bhikkhus, if while a bhikkhu is sitting, a thought of sensuality, a thought of ill-will, or a thought of harming arises, and if that bhikkhu does not tolerate it but abandons it, dispels it, eliminates it, and brings it to an end, even while sitting, such a bhikkhu is called 'with continuous effort, with concern, always with aroused energy, and determined.'
Likewise, bhikkhus, if while a bhikkhu is lying down but awake, a thought of sensuality, a thought of ill-will, or a thought of harming arises, and if that bhikkhu does not tolerate it but abandons it, dispels it, eliminates it, and brings it to an end, even while lying down, such a bhikkhu is called 'with continuous effort, with concern, always with aroused energy, and determined.'
Verse
Whether walking or standing, sitting or lying down; Whoever nurtures harmful thoughts, connected to the household life —
Such a one is on the wrong path, infatuated with defilements; That kind of bhikkhu is incapable, of reaching the highest awakening.
But one who, whether walking or standing, sitting or lying down; Has calmed their thoughts, delighting in the stilling of thoughts; That kind of bhikkhu is capable, of reaching the highest awakening."
Related Teachings:
Developing the mind by classifying thoughts into two categories | Right Intention (MN 19) - The Buddha describes how he cultivated his mind with a careful categorization of thoughts to cultivate and thoughts to eliminate, understanding their relationship and how it inclines the mind's underlying tendencies.
Vitakkasaṇṭhāna sutta - Shaping of Thoughts (MN 20) - The Buddha explains how to cultivate the higher mind through similes: when a harmful or unwholesome thought associated with desire, aversion, or delusion arises, apply these five methods in a gradual sequence.
Causes for Diverse Perceptions, Intentions, Passions, Quests (SN 14.7) - The diverse external elements of sense experience give rise to diverse perceptions, intentions, desires, passions, and quests.