White dwarf stars are only about the size of Earth. They represent stars with about the mass of the Sun that have burned as much hydrogen as they can. The gravitational force of a white dwarf’s mass is pulling the star inward, but electrons in the star resist being pushed together.
The gravitational force is able to pull the star into a much denser form than it was in when the star was burning hydrogen. The final stage of life for all stars like the Sun is the white dwarf stage.