You have to introduce water into the sand. And the easiest way to do that is to make it trickle along your leg into the quicksand, by making a circular motion with your leg.
Everybody thinks, thanks to Hollywood, that you can drown in quicksand. Basically if you do a simple buoyancy calculation, the Archimedes force, it is immediately evident that you can't drown completely.
If you move into the quicksand, this loose packing will collapse. We then have densely packed sand at the bottom, and water floating on top of it. It's the difficulty of getting water into this very densely packed sand that makes it difficult for you to pull your foot out.
The higher the stress, the more liquid the quicksand becomes, so movement by a trapped body causes it to sink in deeply.