When faced with having to hit a golf ball out of a hazard, the golfer cannot test the conditions of the hazard by touching the ground with his hand or club (rule 13-4).
A golfer cannot remove loose impediments in the same hazard.
The golfer is not permitted to build or improve their stance or a lie by moving sand or other dirt around in a hazard.
The golfer also is not permitted to create a stance, swing or line of play by moving, bending or altering anything growing or fixed, such as a tree branch, out of bounds stake and reeds. Doing so would violate rule 13-2. It does not matter whether the object in question is inside or outside the hazard.
Hitting the Ball
When hitting a golf ball out of the bunker, a golfer is permitted to firmly plant his feet (rule 13-3). So, in a bunker a golfer can wiggle his feet until they are firmly planted in the bunker.
Though a golfer can't ground his club in a hazard when addressing the ball (rule 13-4), the club can touch or brush anything deemed to be an integral part of the golf course such as bushes, trees or any other growing thing during address and swing.
The exceptions to rule 13-4 say a golfer is allowed to touch the ground or place his club on the ground in a hazard while falling or trying to prevent himself from falling, while marking the ball's position or while lifting and replacing as specified under the rules.
Once the golfer has hit his ball out of the hazard there are no restrictions on his touching and smoothing the ground or removing loose impediments from the hazard.
Golfers who violate rules governing playing golf balls from bunkers or hazards are assessed a two-stroke penalty in stroke play or the loss of the hole in match play.