Plato’s Phaedo 82d-83e. It is too long a passage to fight with the copy/paste issues from the Loeb database.
…but they themselves consider that they must not do anything contrary to philosophy, and by both the release of the soul and its purification they are turned this way and follow it where it leads (ᾗ ἐκείνη ὑφηγεῖται)..
“How, Socrates?”
“I’ll tell you,” he said. “You see those who love learning recognize that philosophy takes in hand their soul, which is utterly bound up in the body and fastened to it and forced to examine reality through it, as if through prison bars, but not by itself on its own, and is wallowing in total ignorance; and philosophy has discerned that the cunning thing about the prisonis that it comes from desire,as if the prisoner were himself the chief accomplice in his being tied up. So what I’m saying is that the lovers of learning recognize that philosophy, in taking their soul in hand in this state, gently reassures it and tries to release it by demonstrating that inquiry through the eyes is full of deception, as also is that through the ears and the other senses. It persuades it to retreat from these senses except where it is necessary to use them, and encourages the soul to gather and collect itself togetherand trust nothing else but itself in itself, whichever of the realities alone by itself it thinks about alone by itself; but to consider nothing as true that it examines through other means, what is variable in varying conditions: that kind of thingis perceivable and visible, but the soul sees what is intelligible and invisible. So thinking it mustn’t oppose this release, the soul of a true philosopher for that reason keeps away from pleasures, desires, pains, and fears as far as it can, reckoning that whenever you’re over much affected by pleasure or pain or fear or desire you don’t suffer so great harm from these, the ones that you’d think,c for example falling ill, or spending money on your desires, but you do suffer the greatest and ultimate of all evils and take no account of it.”
“What is this, Socrates?” said Cebes.
“That the soul of every person, at the same time as experiencing extreme pleasure or pain over something, is compelled to suppose that whatever it is suffering in particularis the most palpable and most real, even though it’s not so. Things like this are especially those seen, or is that not so?”
“Very much so.”
“Isn’t it in this experience that the soul is especially bound fast by the body?”
“How do you mean?”
“Because each pleasure and pain fixes it as if with a nail and pins it to the body and makes it body-like, supposing that whatever the body says is the truth. You see as a result of sharing the body’s beliefsand enjoying the same things, it’s compelled, I think, to become the same in its habits and upbringing that are such that it never reaches Hades in purity but must always depart infected by the body, eso that it quickly falls backinto another body again and grows there like a seed sown, and as a result of this has no part in communion with the divine, the pure and uniform.”