If you do find yourself stuck in quicksand, the best idea is to lean back so that the weight of your body is distributed over a wider area.
Moving won’t cause you to sink. In fact, slow back-and-forth movements can actually let water into the cavity around a trapped limb, loosening the quicksand’s hold. Getting out will take a while, though.
Physicists have calculated that the force required to extract your foot from quicksand at a rate of one centimeter per second is roughly equal to the force needed to lift a medium-sized car.
One genuine danger is that a person who is immobilized in quicksand could be engulfed and drowned by an incoming tide—quicksands often occur in tidal areas—but even these types of accidents are very rare.