Death and the Afterlife as described in Ancient Skanda Purana, Chapter 40:
According to karma, when the age of death is present for human beings, the messengers of Yamaraja (Yamraja is the god of death and justice, responsible for the dispensation of law and punishment of sinners in his abode, Yamaloka) pull soul out of the body the living beings subject to their actions. Then the soul, bound by virtue and sin, renounces the body, taking along the Panchtantramatra and the mind, intellect and ego. The soul of pious souls comes out through seven holes located in the mouth. The souls of sinners pass out from the anus, and the souls of Yogis break through the Brahmarandhra and travel to the upper world.
At the moment of death, the living entity assumes the non-material body; It is equal to the tip of the thumb. That body is created by its own life. When the soul is established in that transcendental body, then the messengers of Yamaraja bind that body and forcefully carry it through the path of Yamaloka. The path is like a heated barrage, like a heated iron ball, like a place of heated sand, and like a burning copper sheet. Eighty-six thousand Yojans away from the earth is the Puri (Adobe) of Yamraj, where Yamdoots (the messengers of Yamraja) drag the sinners away.
Somewhere it is very cold on the way, somewhere very inaccessible place has to be crossed, somewhere there is heavy darkness, and somewhere like fire-faced cocks, thorns, Jambuks, flies, gnats, mosquitoes and snakes and scorpions etc. get bitten. The creature screams and screams at their bite, but does not die. Somewhere, the fierce demons eat it, drag it and throw it here and there. Somewhere a burning sinful creature is carried by a very terrible route with hot sand. He crosses that very difficult road of Yampuri in only ten Muhurtas (four hours); But the same amount of time he considers as heavy as a year. In that path, the sinner has to cross the dreadful Styx river flowing with exudate and blood, in which only the hairs act as algae.
On reaching Yamlok, the Yamdoots take the sinful man and make him stand in front of Yamraj. The sinful soul sees Yamraj, surrounded by time and death etc., in a very frightening form, and the virtuous soul sees Yamraj in a supremely calm and gentle form. Only human beings go to Yamlok, not other beings. Soon after the death of other beings, they are born in one or the other species. In this way only their species is fulfilled. Only humans are heard to be phantoms, not other beings. On going to Yamaloka, the virtuous person is worshiped there and the sinful soul is put in bondage.
The way righteous men go to the next world : Those who donate garden and tree in this world, they travel happily through the shade of trees bearing fruit and flowers. Similarly, those who donate umbrellas, they also go happily in the shade. The donors of Upanaha (shoe etc.) travel for a quarter of a year. The diggers of wells and ponds go away without the pain of thirst. People who provide rides, beds and seats go on planes. Those who are food donors, they travel very well after being satisfied with food and food. Those who donate lamps go to the light, those who donate cows, cross the river Vaitarni happily. Those who worship Lord Surya, Lord Shiva or Lord Vishnu from birth till the whole life, they go to the abode of God after being worshiped by the eunuchs. By donating land, cow, gold, iron, oil, cotton, salt and saptadhanya, human beings travel happily to the hereafter.
Chitragupta informs Yamraj about the sinful and virtuous men who have gone to Yamlok. Then they stays in Pretlok for one year. In the same year, he attains Bhogadeh(the body which can eat). Brothers and sisters on earth, who donate water-rich Kumbh and donating food etc., they get strengthened by eating them every day. Whatever food he has donated in the past also becomes present to him in Yamaloka himself. One who himself has not donated anything and for whom there is no other donor of food and water, he suffers from hunger and thirst in Yamaloka. The water donated by brothers and sisters reaches him through a river. For the one for whom monthly Shradh is not performed here every month before the Shodasha Shradh, he does not become free from Prateyoni. There is a day equal to the day of a human being in Pretlok. Therefore, the phantom should be given food every day for one year. Protection of the sinner who suffers from cold, wind and sunshine in Yamlok
There is a fierce eunuch with the name Shamashanik. Like even in this world, tough men protect a prisoner who is in bondage. For the one for whom Pretpinds are not given before Shradh, he does not get salvation even after many ages. After giving Pretpind, when the brothers and sisters perform the rituals of Sapindkaran Shradh after the completion of one year, then the enjoyment of the soul is attained to perfection.
The sinful soul attains a terrible body and the virtuous person attains the supreme divine form. Thereafter the living being goes to heaven or hell according to his karma. Raurav etc. hell are situated in the underworld, the deities etc., the virtuous souls reside above the heaven till Satyaloka. The virtuous deeds which are prescribed in history, Puranas, Vedas and Smritis lead to the attainment of heaven.
On the contrary, sinning leads to hell. Whether it is heaven or hell, a man resides there only for a fixed time according to his deeds. The one whose Sapindikana Shradh is performed before the year, his prettva also remains for one year. Those who have performed Yajna through the three yagyas like Ashwamedha etc. or have worshiped these three deities – Brahma, Vishnu and Shiva, or those who have been killed in front of the battle, they never go to the Pretalok.
Only by virtue one attains the only heaven and only by sin one has to go to the only dark perfect hell.
Through the rituals of both sin and virtue, man goes to both heaven and hell and accordingly he gets the body.