If the sand has gotten into the silent button on your iPhone, you can try using a toothpick or a thin piece of metal to try and pry it out. If that doesn't work, you can try using a vacuum cleaner to suck the sand out.