The H-R Diagram: evolution of a star
For countless millennia humans looked at the sly at night and saw millions of flickering lights, night after night it was the same spectacle, unchanged generation after generation. After few hundred generations they had this eureka moment, the sky must be perfect and as such it will be a peaceful never changing place. If only. We now know better and no one in his right mind would consider space a peaceful never changing place. On the contrary, in space you can go from the coldest to the hottest place found in nature and from a place where you can fly around to a place where you get utterly destroyed by gravity. One flickering light is by no means similar to any other and the changes it goes through during it's life span are immense.
A great tool that helps make sense of the position of a star in its life cycle it's the Hertzsprung-Russell diagram (or HR Diagram for short). It's a catalog of the main changes a star go through from beginning to end, the position of the star in it will quickly tell you a lot about the mass, brightness, age and surface temperature of the star.
We'll start from the bottom right of the diagram where we find the smaller, colder and often oldest stars in the cosmos called brown dwarfs. This stars are either born that small or the remnants of main sequence stars at the end of their life cycle. Either way they range in size between Mars size and just a bit bigger than Jupiter. If they are born that small they have just enough mass to start nuclear fusion but because of the small size they don't get a very high surface temperature and they will continue to burn for billions of years longer than a main sequence star, they will be the last stars to exhaust their nuclear fuel. The last burning star in the universe will be a white dwarf, when all the biggest stars will be gone from the sky the only place an intelligent civilization will be able to get any light and heat will be a white dwarf.
Moving up a bit and towards the center we encounter the main sequence stars. Our sun is one of those stars. Not too heavy, not too bright, half way through its life cycle, usually have a reasonably high surface temperature, in the order of few millions Kelvin - our sun has a surface temperature of about 6 million kelvin -. They are usually yellow-orange color and slowly burn hydrogen into helium for anything between 4 and 15 billions years. Our sun is about half way through it's 10 billion years life span, we still have about 5 billions years left before the biggest explosion the solar system will ever see. Unfortunately our planet will become uninhabitable sooner than that. Our sun will keep moving up in HR diagram in about 3 and half billion years when it will stop burning hydrogen and will star burning helium into carbon. At that point it will swell, surface temperature will go up a bit and size will grow up to engulf into it's outer layer the planet mars. We will be nice and crispy.
After a billion years into the helium phase it will go into the last phase, turning carbon into oxygen, unfortunately our star is not big enough to go on after that and it will explode its outer layers into space where they will form a brilliant planetary nebula like the crab nebula we can observe today, a swirling mass of gases and plasma moving in space at thousands miles per second.
If we move up and right, in the uppermost corner of the HR diagram we'll find the blue and red giants. They can range from few solar masses to 100.000 solar masses, their surface temperature is lower than our sun but only because their tremendous size. Some of them are so hot that they can barely hold on their own gases and their future is more spectacular than our humble star. For those stars with mass lower than 9 solar masses the end will come in a similar explosion as our sun thought it will bigger and brighter than our sun could ever manage. They will go on burning different fuel till they reach iron, they will form an iron core and when the iron core reach a critical mass the star will go supernova. An explosion that easily surpass any galaxy in brightness and last few days will leave behind a neutron star or a pulsar, - it depends on how big is the magnetic field of the initial star- and we can find those stars in the lower left corner of the HR diagram.
If the star is bigger than 9 solar masses it will go out with a bigger bang and will leave behind only a gravitational field so strong that nothing will be able to escape it's pull, we'll look at a black hole. The biggest and most destructive celestial body the universe has ever know it's not in the HR diagram, it's way off the chart. The more massive a star is the more quickly it will burn out and the bigger the bang at the end of their life. Stars big enough to die as a black hole will only last few hundred millions years, burning fast and furious and leaving nothing but an invisible force field behind that will last almost as long as the white dwarfs.