Like the full swing you have to practice the bunker-shot setup. Dig your feet into the sand to get a stable base to swing and grip down on the club the same distance your feet are dug into the ground. This will keep your club at a normal length so that you don't hit too far behind the ball. Then open up the club face so that the club will bounce off the sand and throw the ball into the air. For right handed golfers, aim a little left of the target to keep the ball on line.
A good goal when hitting sand shots is to hit 2 inches behind the ball and let the sand lift the ball out. To practice this, draw a line in the bunker 2 inches behind the ball and concentrate on hitting that line rather than the golf ball.
During bunker shots you should always complete a follow through that finishes at least waist high. Doing this will ensure that the club is accelerating through the sand and not decelerating, which almost always leaves the ball in the bunker.