Vasishtha explains the process of death in the Yoga-Vasishtha.
“When on account of diseases of the body its Nadis lose their vigour and thus become unable to expand and contract to exhale or inhale air, the body loses its harmony and becomes restless. The inhaled air does not then adequately come out, nor does the exhaled air re-enter the body. So respiration stops. When respiration stops, the creature becomes senseless and dead. All the desires and perceptions of the individual get withdrawn within himself. The individual with all his Vasanas (passions or previous impressions) within himself is called a Jiva. When the body dies, Pranas of the individual and the Jiva within come out and roam in the air. The atmospheric air is full of several such Pranas which have Jivas within them; these Jivas or souls having their respective world-experiences potentially existing within them—is called Preta (in the astral realm)”
Yoga-Vāsiṣṭha is a philosophical text attributed to Valmiki, though the actual writer is Vasistha. The whole text contains over 29,000 verses. The brief version of the text is named Laghu Yogavasistha and comprises 6,000 verses.