OK here is a cheap and simple way to sort out your underhood light. Most TJ era jeeps have this light under the hood that is seemingly there for looks only.
It operated via a built in gravity switch. The switch looks like a bullet. I was told it had mercury in it and as such Jeep says to replace the whole thing not the bulb. Mine felt like a simple ball bearing type but I didn't dissect it.
The process is pretty straight forward but a bit of a pain.
Disconnecting the wire was my first issue. There is a clip that needs to be pushed out and removed before you can depress the clip release. Mine broke so I used an automotive pick to pry up the catch and slip off the connector.
Once you have the wire disconnected you need to remove the light from the hood. There is a plastic base that detaches from the light assembly. The base is bolted to the hood and the light is removed by pulling the light toward the passenger side slightly and prying it off with a decent bit of force. I did this by hand but you can use a wide flat screwdriver or something similar.
Now once the light is removed go indoors and sit at your kitchen table with a beer while your wife looks at you disaprovingly for bringing parts in the house.
The lens is held on my 4 clips accessible from the bottom of the assembly. I used a put of force to get mine off. I suspect there is a bit of glue in there as well. Be careful not to crack the lens when you take it off.
Now as this is not a serviceable part the original light has been soldered or glued to the contacts. take a pair of needle nose pliers and rip it off. with a twisting motion. the bulb is going to break so watch for glass. The finished product will look like this.
Now the new bulb is not going to clip in there so this is where you get creative. You can use a variety of bulbs out there just make sure it has looped ends. I used a RL4410 bulb like below.
You will use the loops at the end of the bulb and hook the metal leads that the old bulb was attached to. This will require a little pressure and fineness to get it on but once its there it will stay. It will look like this.
Reverse for installation and use a little glue if the lens cracked or wont stay on.
Viola! Let there be light!
This can all be yours for around 3-5 dollars and a little patience.