Odin sacrificed himself on Yggdrasil, the World Tree, to gain knowledge of the runes. He hung from the tree for nine days and nights, pierced by his own spear, enduring great suffering in this act of self-sacrifice. This act allowed him to understand the runes, which are powerful symbols of knowledge and magic in Norse mythology.