First get the spring off the shock.
Release all preload from the spring by turning the preload adjuster’s nuts.
Then slide off the spring retainer from the top of the spring.
Some springs will need to be compressed a little to get the spring retainer off.
If you don't have a spring compressor, in a pinch I have used a few large hose clamps or 2 tie downs on exact opposite sides hooked on one end woven through the other end and hooked back on the original end and then compressed equally, for the small amount needed to compress an lt500 rear shock hose clamps work pretty well. Most springs just need to be compressed a very little bit, then the top spring retainer clip slides right off.