As wrenchbender says, the dome light socket is "hot" all the time. If you have battery to the socket, that's half the battle. Now, to light the bulb, you need a ground on the other wire to complete the circuit. That ground is supplied by the light switch when you turn it all the way clockwise. It is also supplied by the door jamb buttons if your truck has them. Also, as wb says, the switch must be grounded, that's where this particular ground comes from so I'd start there - look at the ground terminal and make sure it goes to a good ground.