“The Buddha replied, “No. Nibbāna is realized by removing greedy, hateful, and ignorant thoughts”. That account is in the “Manōnivarana Sutta (SN 1.24).”
There is also MN 20 Vitakkasaṇṭhānasutta. This is wrongly translated as ‘How to Stop thinking’ It is just a ‘little matter’ of the translators not completing the title with “…bad thoughts”
When you read the sutta you will see that the Buddha was talking about how to stop thinking bad thoughts and replacing them with good ones.
The immediately previous sutta, MN 19 ,Two Kinds of Thought, draws the contrasting characteristics and scope of bad and good thoughts and how to switch from one type to the other. Then the statement: ‘Whatever a mendicant frequently thinks about and considers becomes their heart’s inclination’ The whole of the sutta is a marvellous exposition of the two kinds of thought.