If the car moves even slightly, avoid applying too much power, which can spin the tires in place. Spinning wheels offer less traction. Patiently move the car out of the area and back onto more solid ground.
If the wheels spin and the car is not moving, try “rocking” the car. Slowly give the car power to the point that the tires begin to spin then immediately release power. You will notice that the car slightly rocks forward then back. Do this repeatedly as you try to gain momentum in each rocking cycle. Just like a child pushing a swing, synchronize the push (or gas) so that the rocking motion is increased. With a bit of timing and luck, you could rock just enough to regain traction. (In cars with automatic transmission, rocking requires shifting back and forth between forward and reverse. With a manual transmission, simply engage and disengage the clutch while stepping on the gas.)
If your car is stuck with one wheel spinning while the other is not, try this trick: engage the parking brake two or three clicks. Step on the gas slowly to get the car moving. As soon as the car starts to move, release the parking brake completely. Because spinning wheels don’t have traction, engaging the parking brake allows a clutch in the differentials to energize, causing the car to adjust for increased traction.