The Buddhist Sutra on Mindfulness includes the Nine Cemetery Contemplations, where apprentice monks meditate on various stages of decay in bodies found in a charnel ground. They begin with a swollen, festering body and move through various decomposing forms, including one being consumed by worms, ultimately culminating in a skeleton held together by tendons.
The purpose of these meditations is to confront the reality of death and decay, guiding monks to a state of calmness. As they continue their practice, they eventually find peace and even experience a smile, reflecting acceptance and understanding of the impermanence of life.