Jack-o’-lanterns come from Ireland, specifically the Irish legend of a man named “Stingy Jack,” による History.com.
According to the legend, Stingy Jack tricked and trapped the Devil twice and made the Devil promise not to take his soul.
HISTORY OF HALLOWEEN: THE ORIGINS OF THE HOLIDAY
When Jack eventually died, God didn’t allow Jack – an “unsavory figure,” according to History.com – into heaven. The Devil, who was upset with Jack for tricking him, also kept his word and didn’t allow Jack into hell.