Lighted Switch Wiring
Lighted switches, as with many other devices (smart switches, timers, motion detectors, etc.) need to get power for something else - i.e., they don't just need power for the light.
There are a few ways of doing that:

Batteries - This is incredibly simple but means changing batteries periodically and doesn't work well for a lighted switch because it would drain the battery pretty quickly.
Neutral - This is the preferred method. Unfortunately, many older houses (like mine) were wired with switch loops, which often (older houses: almost always) do not provide neutral in the switch box. Adding a neutral is easy with conduit but hard (usually) with cables. The NEC now requires neutral in the switch box in new installations most cases (except conduit), but that is a very new requirement.
Ground - Ground is electrically equivalent to neutral in terms of voltage level. It is not supposed to be used in place of neutral. However, code typically allows for some very low-current exceptions, including certain types of switches. This is only allowed if the switch is listed (e.g., by UL or ETL) for that installation method.
Leak through Load - This is an old method that avoids extra wires (yay!) and batteries, but it doesn't work well with LEDs. A small current passed through incandescent bulbs will normally not be noticeable. With LEDs, it can do any/all of: dim light on when switch is off, blinking, not work at all, work but cause the LEDs to fail prematurely. In general this will have a better chance of working with dimmer-compatible LEDs, but even that is not 100% guaranteed.

Your best bet in general is:

If you have (or can easily add) neutral, get a switch that requires neutral, as that will mean it is designed to use neutral and not to leak through the load.
If you do not have neutral, see if you can find a switch that specifically does not require neutral and requires ground. Note that almost all switches will include a ground screw or wire, but in many cases it is not required. You are looking here for something that must have ground.