Extended contact with water, exposure to heavy storms, or full immersion can damage the Pixel Buds. Dirty water can cause a greater risk, too. Mud or sand, whether dissolved or not, can break down ...
Most smartphones these days have some sort of IP rating, and the Pixel 9 series is IP68 rated. The first digit, 6, means the phone is dust-tight and can withstand small dust and sand particles.