The .idx file extension is used by a lot of programs for different kinds of files. Here, we are discussing the IDX files that you find when downloading video. These IDX files are for subtitles.
Some video subtitles use text. Others use graphics. So, if the video that you downloaded uses the graphics method, you will have a large .sub file containing the subtitle graphics, and a smaller .idx file. The IDX file tells your video player which subtitle graphics to show during which frames.
If you don’t need the subtitles, you can just throw away the IDX files. Your video player will get along just fine without them – or the .sub files.