Thanks for the reply, but I think I didn't explain myself clearly enough. The electrical parts of the socket are working, it is the box in the wall that is broken.
I need to replace this piece:
What I need to do is disconnect the existing socket (as you outlined), but then I need to pull out the box from the wall and replace that. What I'm trying to understand is how to get the box out of the wall, hopefully without making a huge hole in the process.
I can find lots of instructions on how to replace the outlet, for example:
But I haven't found anything for replacing the box that the outlet goes in.