White dwarf stars form when a normal start stops burning and starts to shrink, but this only occurs when the solar mass of the star is between 0.07 and 1.4. The creation of the white dwarf is affected by both gravity and pressure, which work against each other trying to change the size of the star. Gravity wins the battle, which causes the star to shrink by pulling the outer layers inward.
Most white dwarfs are similar to the sun, in respect to their composition of oxygen and carbon masses. There is a large difference in their size though, with most white dwarfs being similar in size to the Earth and burning much hotter than the sun. It seems strange that a white dwarf would be hotter than the sun, since the dwarfs are burnt out stars, but the size has to be taken into account. The mass of the star is pulled inward making the star more compact and able to hold onto its heat; it is simply their luminosity that is low. The white dwarf stars can cool in different ways, but one of the most interesting effects of the stars cooling is the lattice structure that forms over the outside of the star making a crystal like structure. Eventually, the star will become a solid crystal black dwarf, but this process takes billions of years.