Any bunker shot requires you to make contact with the sand and the ball at exactly the right point, otherwise if not - as you've probably already discovered - things can get a little messy on the scorecard.
But the classic "bunker divot" drill will help you become a more consistent bunker player - others like to call this one "the line in the sand."
Obviously you can't touch the sand before making contact with the ball in real time out on the course, but in practice you can obviously do whatever you want. This particular drill is best suited for a medium-length shot, somewhere in the region of 10 to 20 yards and where the ball is sitting up.
As you can see from the image above, the two yellow dotted lines represent the line in the sand that you should draw. From there, you want to try and hit the sand an inch after the line where the ball would be sitting.
INSTRUCTION: 6 STEPS TO MASTER BUNKER SHOTS LIKE SERGIO GARCIA
Keep trying to connect with the sand an inch past the line a few times to improve your consistency.
Once you feel confident hitting the sand an inch after the line drawn in the sand move on to using an alignment stick and a ball. Just like the line drawn, use the alignment stick as a marker for not grabbing too much sand before you connect with the ball.