Cool star

What can lead to the sun to the complete lack of solar energy and degradation to the black dwarf, how long does a black dwarf last? In order to cool any star to absolute zero, it takes more time than the whole universe exists.