A centrifuge is a machine that spins around to create a large and powerful force. In other words, it puts an object in rotation around a fixed axis applying a force perpendicular to the axis. A centrifuge is normally used to separate two liquids of different densities. It is widely used in scientific laboratories to separate blood components and also aerospace labs.
The complex mixture to be separated is placed in a container and rotated at a high speed. Both light and heavy particles of the mixture is subjected to a kind of force called centrifugal force. Centrifugal force is not actually a force but inertia (a tendency of the object moving in circular or straight path to continue moving in the same path unless acted upon by an external force). This inertia or the centrifugal force acts to draw a rotating body away from the centre of rotation. Because of centrifugal force, the dense particles move away from the central axis of rotation and the lighter ones move close to the centre. A classic example of centrifuge is a milk separator which was invented long time ago to separate milk into cream and skimmed milk.
The drum that you see inside a washing machine is also a kind of centrifuge. When spinning action takes place, the clothes spin around the centre. The ‘centripetal’ force which is a real force pulls the rotating object (clothes) towards the centre of what it is rotating around. To this centripetal force, there acts an equal and opposite reaction called centrifugal force. The centrifugal force is not a true force as explained above. This acts to pull the water molecules away from the clothes and the water escapes through the tiny holes in the drum resulting in drier clothes. The difference between centripetal and centrifugal force has to do with the viewpoint from which we measure something. In simple words, centripetal force is directed towards the centre and centrifugal force is directed away from the centre.