Carefully remove the cigarette/ashtray from the car. Pry at the top lightly, then the sides.
Disconnect the power and the light.

Remove the lighter from the socket and you will see:

On the sides you will see the ground fingers

The power clip:

Using a dental pick pry out the fingers both of them.

For the power clip, use a flat blade to push the fingers back in place DO NOT OVER BEND.

Reconnect the power, and the light and replace in the car.
If the socket is too gone, then you can get replacements at most auto parts stores or the junk yard of your choice.