Obtain two nuts of the correct size, run the first one down the stud, almost all the way to the end, leaving maybe two to four threads showing. To make things easier, use a little WD-40 or light oil to clean and lubricate the threads. With the first nut in place, run the second one down until it just touches the first. Use a wrench to tighten the lower nut against the upper one, jamming them together (you’ll need a wrench to hold the upper one as well to prevent it from turning). Next, place a wrench on the lower nut and turn it counter-clockwise; the stud should walk right out. To install the stud, place your wrench on the top nut and turn it clockwise. Once you’re done with the stud, break the nuts loose from each other and they’ll spin right off.