Rusted valve need help removing
You have to shut the water off first, is this a well or city water?
I solder 2, 6" long pieces of copper pipe to the new valve (valve needs to be open when soldering) hold it up to the piping you have now and mark where to cut, make sure to make the cut so there will be about 1/4 of room on each end.
Cut the pipe, clean it with emery cloth, clean the new pipe, add flux and use what's called repair couplings. It's sweat copper couplings with no rib in the middle of them so they can be slide over the tubing. Set everything in place and solder it.
Make sure it's soldered where the handle can be turned.