How can astronauts or scientists in a space station tell if a nearby sun is going to explode into a supernova? What would be the methods and how would they be warned?
We can't predict those yet but some people think Eta Carinae might be an example of a star about to become a supernova: On the other hand, the hydrogen in the star mostly all gets fused into oxygen atoms before a nova reaction so I suppose a spectrograph analysis of a star might be a key clue.
Another thing to keep in mind is that 99% of the stars in the sky are lightyears away from us (excluding our own, of course.) Let's pretend a star five lightyears away goes supernova. It would take five years for the light to go to the eyes of everyone onboard the ISS. By that point, the star would've long since gone supernova.
http://aspire.cosmic-ray.org/Labs/StarLife/starlife_end.html As the goes over, the star will start fusing helium, and then carbon as it grows hotter. Not every star will go super nova, in fact the majority will not. But leading up to the supernova is a period of expansion. The star will grow around 1000% of it's current size over a period of a million years or so. That's the best indicator that a supernova might happen.
Go to the public library and pick up The Teaching Company course on astronomy. You will learn how and much much more to use for your writing pleasure.
I'm assuming you're setting your story in another star system - the scientists may be studying the star up close. Let's take Betelgeuse as an example - a red giant star that could go nova any time - it may already have gone nova, but the light from the event has yet to reach Earth. However, if the scientists were in a space station in orbit around the star, they would see the event unfold only minutes after it occurs. At that close range, they might see a bright flash as the star runs out of fuel. From that point, the balance between the explosive force of the nuclear fusion reaction and the compressive force of gravity gives way, and the outer layers of the star blow outwards, irradiating everything in orbit. The rest of the star would collapse in on itself, creating either a white dwarf (if it is a light star) or a neutron star / black hole (if it is a heavier star). Without adequate shielding, the scientists would be roasted by the burst of ionizing radiation, then crunched up by the gravity of the black hole (if one formed). Even with shields, they would need to travel at speeds close to those of light to escape the gravity well. That's just how I imagine it.