Anubis invented embalming to embalm Osiris, the first mummy. He was the guide of the dead. The Egyptians embalmed their dead, especially their pharaohs, to preserve them, since they thought that this helped them live for ever.
The Ancient Egyptians believed that when you died, you travelled to the Hall of the Dead. There Anubis weighed your heart against the feather of Ma'at. Ma'at, the goddess of justice sits on top of the scales to make sure that the weighing is carried out properly. You can see Anubis steadying the scales to make the weighing fair. If your heart was lighter than the feather, you lived for ever. We still talk of "a heart as light as a feather" to mean care-free, and "heavy-hearted" to mean sad. If your heart was heavier than the feather then it was eaten by the demon Ammit, the Destroyer. Ammit had the head of a crocodile, the shoulders of a lion and the rump of a hippopotamus. These were all frightening animals for the Egyptians. Thoth, god of wisom and writing, stands by to record what happens.