The modern-day carving of pumpkins into lighted faces is generally traced back to European folk practices of doing similar carvings on turnips and other vegetables in order to keep away evil spirits. However, such practices have only been associated with Halloween in the last 150 years or so.
There is absolutely no historical evidence that the face of a jack-o-lantern is supposed to represent Satan or a pagan god, nor is it used to curse people or attract spirits.
One particularly nonsensical claim about jack-o-lanterns is that Druids were the first people to carve pumpkins into demonic shapes. Europe has only had access to pumpkins for the last 500 years, and the ancient Druids vanished more than a thousand years ago. In addition, "demonic" is a term that largely only makes sense within a Judeo-Christian context, and the Druids were not Christians.