Spell 125 of the Egyptian Book of the Dead describes the judgement of the dead in the Hall of Two Truths. The heart is weighed against the feather of Maat, and the deceased addresses a bench of forty-two assessors, each named, each associated with a place, and each answered with the denial of one specific offence. The declarations are conventionally called the negative confession, and they are declarations of innocence rather than confessions of anything: I have not stolen, I have not killed, I have not diverted the flood water, I have not made anyone weep.
The list is one of the most substantial ethical documents to survive from the ancient world, and it is worth reading for what it prohibits, a good deal of it concerns irrigation, weights and measures, and the treatment of temple property, which is to say the ordinary conduct of an agricultural society, alongside the crimes any tradition names.
Two qualifications matter. The count of forty-two is the canonical one, and the earliest examples date to the Eighteenth Dynasty, but real papyri vary: the ordering differs, the pairing of a particular deity with a particular offence differs, and the number of declarations is not identical in every surviving copy. Forty-two is the idealised figure.
The explanation usually offered, that the forty-two assessors correspond to the forty-two nomes, the provinces of Egypt, is a modern scholarly conjecture and not something any Egyptian text says. Forty-two nomes, twenty-two in Upper Egypt and twenty in Lower, is the system that prevailed for most of pharaonic history, but the number varied across periods, and the connection to the assessors is an inference presented far too often as an attested fact.