Swing out toward the target (above, left). You need to keep the clubface open through impact. That's what allows you to slide the club through the sand. If you think about swinging to the target, the club stays to the inside on the downswing, which helps you hold the face open. Play the ball off your front foot, open the face, and swing in to out, slapping the sand behind the ball.
Don't cut across the ball (above, right). When you swing from out to in through the sand, the clubface tends to get closed to the target. It's difficult to hold the face open when the path is going hard to the left. When the face closes, the clubhead digs in the sand instead of sliding through. That takes speed and loft off the shot—the two things you need the most in greenside bunkers.
When your ball is buried in a bunker (above), you have to tweak your technique to get it out. Play the ball in the middle of your stance, open the clubface, and pick the club straight up on the backswing. Swing down steeply into the sand behind the ball. With all this energy going down into the sand, you won't have much of a follow-through. But don't quit on it too soon: You have to swing firmly to force the ball out. And expect plenty of roll.
Butch Harmon, a Golf Digest Teaching Professional, runs the Butch Harmon School of Golf, Henderson, Nev.