Anna - If you mean before putting it in the tank, some have suggested filling rice sacks (or similar bags) with new sand for washing.
If you mean after it is in the tank, it has been my experience that sand packs down pretty well and allows for use of a turkey baster to pick up debris from the top of it, or a syphon hose, or battery/air powered aquarium vacuum.