Upon reachning the Hall of Osiris, the AKH would undertake perhaps the most difficult challenge before reaching the Beyond -
Judging the dead dates back to the Old Kingdom - when it was Osiris himself who deliberated upon the eternal life / complete death (Osiris would separate the dead into two categories 'the Prospering and the exterminated'. But this type of trial only came into existence when Maat (the natural and just order) had been threatened.
At some point between the Old and Middle Kingdom the judgement of the dead became a standard proceedure for the dead, and it was also more of an automatic decision.
The better known version of the Judgement of the Dead came into force (and its final form) in the New Kingdom - along with the Book of the Dead included with spells to help the AKH pass the test.
The usual weighing scene shows the AKH being lead by the hand by Anubis - it is Anubis who will perform the weighing, the heart is placed on the left scale, the feather of Maat on the right. The god Thoth stands ready to record the result, an interested AMEMAIT (the 'Devourer of the Dead') waits for the decision - if the heart is heavier than the feather of truth then she will devour the heart and the AKH / deceased with suffer the final complete death. Spells included with the 'Book of the Dead' enable the dead to plead with its own heart 'not to oppose [the dead] in the realm of the dead'. In the very top part of the scene the AKH also makes offerings to 12 of the major gods who sit in judgement.
Declaration of innocence before 42 gods
The trial is not over yet - the deceased then has to make a declaration of independence before a tribunal and divine advisory board:
Every one of the 42 gods is addressed by individually - each time a denial of wrong doing must be made by the AKH / deceased before it may continue.
Differing versions of the Judging of the deceased vary over the years - various monsters, tortures await the corrupt (in the Books of the Netherworld the dead are tied to a stake by enemies and can only be freed by Re, the Book of Caverns show the punished with burning torches where their heads should be, during Roman times a boiling cauldron also awaits the corrupt (as well as the devourer!)).
Finally after passing these tests the deceased was finally allowed into the Beyond where it could live for eternity in paradise: