
Rule 12.1 says a ball is in a bunker if any part of the ball touches sand on the ground inside the bunker or any part of the ground inside the edge of the bunker on which there is normally sand.
A ball is not considered to be in a bunker if it lies on soil or grass inside the edge of the bunker without touching any sand. Therefore, if the ball is plugged in the earth face of a bunker, it is not considered to be in the bunker. You would be entitled to proceed under rule 16.3b if you wished to do so and take free relief outside the bunker.
If you want to take relief for an unplayable ball in a bunker, you have the same three options as in general area – stroke-and-distance relief, back-on-the-line relief and lateral relief, all for penalty of one stroke. Upon dropping back-on-the-line or in taking lateral relief, the ball must stay in the bunker.
Rule 19.3b gives you one more relief option for an unplayable ball in a bunker, under penalty of two shots you can take back-on-the-line relief outside of the bunker.
Prior to making a stroke in a bunker, you can touch the sand without penalty in the following circumstances: Digging in with your feet to prepare for a practice swing or the stroke, smoothing an area of the bunker to care for the course, leaning on a club to prevent a fall, placing equipment in the bunker or measuring, marking and replacing for a Rule.
You mustn’t improve conditions affecting the stroke by touching the sand. If you do that, it’s a general penalty. And you can’t test the condition of the sand to gain information on the stroke.
You can’t touch the sand with a club right in front or behind the ball, in making a practice swing or with the backswing of your stroke. If you do, it’s the general penalty.
You may remove loose impediments but if you cause the ball to move, it must be replaced, and you receive a one-stroke penalty.
If the ball moves when you’re removing a movable obstruction, like a rake, there is no penalty, and the ball must be replaced.