A centrifuge is an instrument used to separate and compact a precipitate in a test tube. It works by spinning the test tube at high speed, which causes the precipitate to settle at the bottom of the tube. This makes it easier to separate the precipitate from the liquid in the test tube.