How does a pressure suit work? I recently learnt that a suit called pressure suit is worn by fighter plane pilots to prevent red-outs and black-outs. And it seems to be work by -

"..applying pressure to selective portions of the body."

How do these suits work; i.e. by what means, selective portions of the body are pressurised? 
Do astronauts wear these while takeoffs, and also F1 drivers?
 A: If the body is subjected to high accelerations directed towards the feet the heart is unable to pump blood to the brain and unconsciouness results. There are no end of TV programmes showing such experiments in centrifuges, for example a quick Youtube search found this.
The type of pressure suit you mention compresses the legs and forces the blood in them upwards. This makes it easy for the heart to maintain the circulation and allows the pilot to remain conscious to higher forces.
A: they provide mechanical constriction to the limbs and torso to prevent swelling in the event of decompression. hands, feet and face are not assisted. 
astronauts wear full pressure suits for ascent and re-entry.
the main concern for F1 drivers is fire resistance not low air pressure.
https://airandspace.si.edu/collections/artifact.cfm?id=A19730755000
A: The suits are designed to provide protection from the temperatures +100F to -90F.
When pressurized to 3.5 pounds per square inch (roughly equivalent to the atmospheric pressure at 35,000 feet), the suit can help to avert symptoms of decompression sickness (the "bends").
Above about 62,000 feet, the liquid in pressure suit  tissues could turn to gas and expand dangerously, a condition called ebullism, but the suit will maintain pressure around his body to prevent such expansion.
The exterior of the suit is made of a material that is both fire retardant and an insulator against extreme cold.
A "controller" is the "brain" of the suit. Only the size of a hockey puck, it's an extremely reliable mechanism for maintaining pressure automatically at various altitudes.
