Use a length of garden hose and start to syphon the sand out into a 5 gallon bucket. Do as much as you would to perform a water change, maybe 2 buckets full. Dont put the water back into the tank. Get rid of the sand and water. Do this over the course of a few days or a couple weeks or whatever you like until all the old sand is gone. You can replace the sand with new as you go.
Doing it this way you are not letting any of the junk in the old sandbed to be released into the tank, you are pulling it directly into the bucket. . This procedure is part of my general maintenance program. I have syphoned out and replaced the entire sand bed in my tank at once several times. How much sand bed you take out at once depends on how much water you want to change at one time.