You can remove loose impediments and movable obstructions, but some contact with sand is restricted.
Plain-language guide · Rule 12.2. Use the current official text and your round’s Local Rules for a ruling.
What to know
Do not test it or touch it with your club directly in front of or behind the ball, in a practice swing, or in the backswing. Other actions have exceptions.
On the course
Take your stance, keep the practice motion clear of sand, play, then rake the disturbed area.