Assuming the circuit is on an RCD (if not - no socket allowed by the Wiring Regulations):
- Turn off the power.
- Remove the existing accessory.
- Replace it with a socket.
But but but but but....
Why do you want to swap it?
What will you be plugging in?
Is there a door on the cupboard?