There are various techniques for getting out of sand, but using the same principle as the flop shot is very effective. The main difference is that you hit the sand first, not the ball. If you were to take a divot with a practice swing (which is not permitted during play) the ball would have been in the center of that divot.
Just like the flop shot, let the club do the work and keep the arms and center moving to a follow through. If you want to get the ball up faster, hinge your wrists in the back swing.
A good rule of thumb for soft sand and good lies is to open your stance and your club face. For bad lies, wet or hard sand, square your stance and close your club face. Remember: hit the sand first and follow through keeping your arms and center moving.
Keep in mind it is against the rules to ground the club in a hazard and test the depth of the sand. You are permitted to take a fair stance, so moving your feet to get a balanced position is permissible.