In his commentary on the Diamond Sutra (Chapter 18: “Reality is a Steadily Flowing Stream”), Thich Nhat Hanh recommends reading the Sutra called “The Manifestations of Consciousness”, which is part of the Ratnakuta Sutra (a big Sutra that is basically a collection of shorter Sutras).
In that Sutra the Buddha is asked the following question:
“World-Honored One, although sentient beings know that consciousness exists, they cannot understand it thoroughly if it is not explained clearly, just as no one knows that there is a treasure if it is locked up in a box. World-Honored One, what form does the consciousness assume? Why is it called consciousness’ When sentient beings are dying, they frantically jerk their hands and feet, their eyes change color, they are constricted and cannot move freely, their sense-organs function no more, and their [ four] elements disintegrate. After the consciousness leaves the body, where does it go?”
There are two different English versions of this Sutra available (that I know of).
This one contains translations by Garma C.C. Chang of several Sutras from the Ratnakuta. The “Manifestations of Consciousness” is Chapter 12, which starts on page 223:
https://terebess.hu/english/Maharatnakuta.pdf
Another translation is available online here:
https://www.sutrasmantras.info/sutra18.html
The original Chinese translation by Divākara (地婆訶羅, 613–87), aka Rizhao (日照), is at cbeta here:
https://tripitaka.cbeta.org/ko/T12n0347