Replace corroded copper water pipe
I recommend that you first get to work with a spade or shovel and remove a lot of the soil in that area so you have room to work and better access to more of the piping that is shown.
THEN, shut off the water at the street meter and find a suitable place to cut out the old pipe and valve and replace with new material.
Then put a valve box around the repair instead of putting the soil back in the hole.