About 6 % of all known stars in our part of the Milky Way are white dwarfs. When a small star runs out of fuel, it produces a planetary nebula. The outer layers of the nebula drift away from the star leaving a white dwarf.
A white dwarf is a bright, hot, compact star. They are about the same size, in terms of volume, as the Earth. However, they contain about as much mass as the Sun. Because of their small radius, they are very faint. A typical white dwarf shines with only 0.1 - 1 % of the brightness of the Sun. Our nearest white dwarf is Sirius B but it is too faint to see with an optical telescope.
White dwarfs do not release energy through nuclear fusion reactions. The light and heat they emit are left over from previous stages of their evolution. Despite this, white dwarfs have some of the hottest surface temperatures of any star. They can be over 100,000 °C!
White dwarfs do cool down, but very slowly. Their small surface area means they radiate their heat away very slowly. It will take a white dwarf billions of years to cool down to temperatures near 10,000 K. For comparison, the Sun's surface temperature is around 6,000 K.
The material within a white dwarf was created by its parent star during its main sequence and red giant phases. This material is compacted into a relatively small space, which makes white dwarfs very dense. The density of a white dwarf is about 1 million tonnes per cubic metre which is 200,000 times as dense as the Earth! Imagine the mass of the Sun, squashed to the size of the Earth! A matchbox of white dwarf material would weigh the same as fifteen elephants!
The material is so compact it reaches a state known as neutron degeneracy. The normal relationships between temperature, pressure and density do not hold for degenerate matter. As the mass of a white dwarf increases, its radius decreases. There is a maximum mass beyond which a white dwarf becomes unstable and collapses to form a black hole. This limit (known as the Chandrasekhar Limit) is about 1.44 solar masses.