Jack was a lazy but smart farmer. One day he lured the devil into a tree and trapped him by carving a cross into the treetrunk.
Jack would not let the devil out, until the devil promised him that he wouldn't be welcome in hell.
When Jack died, he wasn't allowed into heaven, because his life had been too sinful. However, the devil who kept his promise, also did not let him into hell. He kicked Jack out and threw and hot coal (piece of hell) after him. Jack was doomed to roam earth forever. He carved out a turnip (later pumpkin) and put the coal inside it to create a lantern. He took this lantern with him on a search to find a resting place he would never find. That why he is called Jack of the Lantern (Jack met de Lantaarn)