To pass from life to the realm of dead - the Afterlife - was seen to be a 'moment of truth' for the ancient Egyptians. At this moment he or she faced judgment. From the New Kingdom into the Roman period ,some provisions could be made for the suitably resourced Egyptian to meet this trial of judgment with the help of spells or utterances included in the Book of the Dead, a copy of which would be buried with the deceased.
Here is a section of a painted papyrus,
Book of the Dead, Papyrus of Ani: Ani's Judgment.
The heart of the dead man is weighed in the scales of the balance against the feather of righteousness.