If your lamp socket is loose, there are a few things you can do to fix it.
First, try tightening the screws that hold the socket in place. If that doesn't work, you may need to replace the socket. To do this, first turn off the power to the lamp and then unscrew the old socket from the base. Once it's removed, screw in the new socket and reattach any wiring. Finally, turn the power back on and test out your new socket!