This is a debate that seems to come up almost every year among my group of friends, and it's really difficult for me to decide which is ultimately the better family friendly Halloween film.
Ernest Scared Stupid came first in 1991, and the late Jim Varney's Ernest P. Worrell character gets a rather deep lore dive. Turns out the reason why he's so incredibly stupid is because an ancient troll named Trantor placed a curse on Ernest's ancestor Phineas, dooming each of his descendants with increasingly diminishing intelligence until one is stupid enough to free the troll from his prison. The film is tonally all over the place, with really goofy antics from Ernest on one end, and some legitimately really creepy scenes with Trantor on the other. But I think that dynamic really captures the spirit of Halloween rather well. And the opening credits montage slaps.
Hocus Pocus came a few years later in 1993, and follows the story of three kids who accidentally resurrect three witches on Halloween night. This is a much more well known film, and I don't really think I need to say much about it. It's tonally more consistent than Ernest, but it never really has any creepy moments. The one aspect that I always felt a little weird about was all of the virgin shaming, and how much it really lingers on the subject in the first part of the film.