It’s said that Lord Ganesha’s mother, Goddess Parvati, carved an idol of a boy out of turmeric powder and breathed life into it, unbeknownst to her husband, Lord Shiva.
So, when Ganesha denied Lord Shiva entry into his abode because Goddess Parvati was bathing inside. Shiva decapitated Ganesha’s head in anger. According to legend, an elephant was the first animal that Lord Brahma later found when he went out to look for one (to replace Ganesha’s head).
Ganesha with his parents, Lord Shiva and Goddess Parvati, and brother Lord Kartik.