Although the origins of any long-standing tradition are murky, most historians agree that Halloween’s origins date back 2,000 years to the ancient Celtic festival of Samhain (pronounced sow-in). Celtic people, who lived in the area that is now Northern Ireland, the U.K., and parts of France, celebrated this festival on October 31.

Not only did Samhain mark the end of the harvest and the beginning of winter, but, according to the History Channel, it was also a day where the “boundary between the worlds of the living and the dead became blurred.” It was believed that on the night of Samhain, ghosts of the dead returned to the earth. As such, enormous bonfires were built, animals were sacrificed, and people wore costumes (usually also of animals) in sacrifice to Celtic deities.

Source: https://www.distractify.com/p/when-was-halloween-invented