the easiest i think without seeing any pic. would be to get a new shutoff valve and some pex pipe and shark bites . cut it back to good pipe and install the new pex with some shark bites avaiable at amazon , home depo or most any ace or the like here is what i mean.
https://www.amazon.com/SharkBite-Cou...zcF9hdGY&psc=1