I recognize this from my studies of Buddhism and specifically returned to the Kayagata-sati Sutta which I looked up - I remember very fondly this passage from it:
“And further, when walking, the monk discerns, ‘I am walking.’ When standing, he discerns, ‘I am standing.’ When sitting, he discerns, ‘I am sitting.’ When lying down, he discerns, ‘I am lying down.’ Or however his body is disposed, that is how he discerns it. And as he remains thus heedful, ardent, & resolute, any memories & resolves related to the household life are abandoned, and with their abandoning his mind gathers & settles inwardly, grows unified & concentrated. This is how a monk develops mindfulness immersed in the body.
“And further, when going forward & returning, he makes himself fully alert; when looking toward & looking away… when bending & extending his limbs… when carrying his outer cloak, his upper robe, & his bowl… when eating, drinking, chewing, & savoring… when urinating & defecating… when walking, standing, sitting, falling asleep, waking up, talking, & remaining silent, he makes himself fully alert. And as he remains thus heedful, ardent, & resolute, any memories & resolves related to the household life are abandoned, and with their abandoning his mind gathers & settles inwardly, grows unified & concentrated. This is how a monk develops mindfulness immersed in the body.
“And further, the monk reflects on this very body from the soles of the feet on up, from the crown of the head on down, surrounded by skin and full of various kinds of unclean things: ‘In this body there are head hairs, body hairs, nails, teeth, skin, flesh, tendons, bones, bone marrow, kidneys, heart, liver, pleura, spleen, lungs, large intestines, small intestines, gorge, feces, bile, phlegm, pus, blood, sweat, fat, tears, skin-oil, saliva, mucus, fluid in the joints, urine.’
And it raelly begins to take off from there, including even the description of corpses, and how it is important to develop mindfulness to never focus on the body.
The full text is available here.
I am not a Buddhist, but I have always found Buddhist texts instructional in terms of building a psychological framework for understanding a thing since they tend to be quite practice oriented.