My first guess would be the footwell courtesy light. Provided the fuse hasn't been pulled or a switch hasn't been added, lights in the footwell should illuminate when you open the doors.
You could cross reference the wire colors to the FSM for your year of TJ. Diagrams of all the plugs are also provided. You can download free PDF's in the Resource section of WTF...
This post is for TJ documentation like Factory Service Manuals Etc..
A while back I was able to find the FSM for my 2006 TJ. I decided to look at the same website I have used to download FMS to see if I can find others. I hit the jackpot so I am sharing :beer-toast1:
Please if there are any issues or they are inaccurate let me know.
Thanks
@UpperMI for the additional 2002 manuals