The story of ‘Stingy Jack’ is an Irish myth and goes like this:
Jack invited the Devil to have a drink, and as his name implies, Jack refused to pay for the drinks. Jack convinced the Devil to turn into a coin to pay for their drinks, but Jack pocketed the coin instead and placed a cross next to the coin, so the Devil couldn’t turn back into himself. Eventually, Jack allowed the Devil to turn back with the promise not to harass Jack for a year or take his soul should he die.
When the Devil visited Jack the following year, Jack convinced the Devil to climb into a tree to retrieve fruit. While the Devil was in the tree, Jack carved a cross on the tree which trapped the Devil. Jack eventually freed the Devil with a promise not to harass Jack for ten years.
A couple of years later, Jack died. God would not allow Jack into Heaven due to his unsavoriness. Because he could not claim his soul, the Devil would not allow Jack into Hell, but he gave him burning coal to light his way. Jack placed the lump of coal in a carved-out turnip and has been wandering the Earth ever since.
To keep Jack away, Irish and English residents began carving scary faces into turnips or beets and placing them in their windows and doorways. Eventually Jack of the Lantern shortened to Jack O’Lantern. When immigrants came to America, they brought the tradition with them and found the native pumpkin to be a perfect fruit for a Jack O’Lantern.