Welcome to the forum.!
Not knowing what type of light you have, I would guess either the socket contact or the bulb contact needs burnishing to remove light corrosion. Take a pencil eraser and rub it on each contact until it becomes shinny. It could also be the socket contact has bent and only makes contact when the bulb is pressed. If you could be specific and describe the type of light your talking about we can be of more help.
2007 Newmar DSDP 4023
Discovery is seeing what everyone else has seen and thinking what no one else has thought.
If you want to see what man made go East; if you want to see what God made go West.