Ican’t exactly answer this, but i can try to give a bit more info here.
astronomers are able to calculate a star’s life expectancy depending on its mass. (a larger star burns more gas, therefore having a shorter life span).
so astronomers can definitely predict the death of stars and the times they will die.
i hope this was in some way : )