How to Connect Device to Relay?

Leave the lamp's cord intact.
Wire the relay to a socket, in-line or panel mount (on a box).