Assuming you have a standard, good quality stock:
Extend the stock by squeezing the lock lever on the bottom and sliding the stock all the way open.
Grab the rear of the locking lever and pull it outward. This will allow you to slide the stock off the buffer tube.
On the bottom of the locking lever is a round nut, usually with an oblong slot in it and a roll pin cross-wise in the slot.
Brace the nut on a hardwood or brass anvil with a hole to pass the roll pin.
Carefully drive out the roll pin with a small punch.
With the pin out, unscrew the round nut. There's a slot in the bottom of the threaded locking pin so you can use a screwdriver to hold the locking pin as the round nut is unscrewed.
With the nut off, turn the stock over, and the threaded locking pin and it's spring will drop out the hole in the top of the stock.
If you also need to remove the buffer tube from the upper receiver, use a spanner tool to unscrew the ring from the buffer tube a few turns, then unscrew the buffer tube from the upper.
When the tube is unscrewed, the buffer retaining plunger and it's spring will be released inside the upper.