Hi, I have an old electrical socket that I'd like to get rid of and patch up. Can i cap the wires and just leave them in the wall? What is the proper way to do this?

My initial thought was to cut the wires where I have access in the basement, but it turns out its in the one part of the basement where i dont have access. So, im left with leaving them in the walls hot.