I've been thinking about star trek 2009 and star trek Picard in which they happen to talk about a sun inside a fictional solar system which goes supernova destroying a particularly important planet to a militaristic alien species. This got thinking, could you know in advance whether it be in days/weeks/months/years/decades when a star is most definitely going to go supernova? Or is it rather indeterminate or chaotically random when such event will take place?
At the moment, our understanding of the final, pre-supernova stages of stellar evolution are not good enough to give precise warnings based on the outward appearance of a star. Typically, you might be able to say that a star might explode sometime in the next 100,000 years.
However, there is an exception. There are ways to establish when a star is approaching the final few days of its existence from an acceleration of the neutrino flux and energy from its core, associated with the higher temperatures of silicon burning.
Even more precisely, you could get a few hours notice of a core collapse supernova from a spike in the neutrino signal that should emerge some hours ahead of the shock wave reaching the visible photosphere (and which was detected on Earth for SN 1987a). Similarly, one might expect a gravitational wave signal from the core collapse event.
Our models of stellar evolution tell us what life stages a star will go through if we know how massive it is. Those models also tell us in general terms how long each stage of that process will last, but the uncertainties are significant, and so the models cannot predict the time-to-supernova with any precision at all.
However, during a star's last stages of evolution, the stages get shorter and some of the uncertainties diminish; it is known for instance that a star headed for a supernova will only spend a few tens to hundreds of thousands of years in the red-giant phase before going kaboom- a process which takes only a couple of seconds at the end of a lifetime that might span hundreds of millions of years to billions of years.
So, we can't predict when a star will blow, even though we know it is in the final stages of getting ready to do so. For example, the star Betelgeuse (the reddish star indicating Orion's upper left corner) is known to be in the red giant phase, and teetering on the brink of blowing up- but it could happen tomorrow, or 10,000 years from now.