How will a massive star change at the end of the main stable period?
When a massive star runs out of fuel it undergoes core collapse and explodes as a supernova.
Stars larger than about 8 solar masses are able to fuse increasingly heavy elements. When its core is mainly iron, then fusion can no longer take place as it requires energy to fuse iron rather than releasing energy as is the case for lighter elements.
Once fusion stops, the iron core collapses under gravity into either a neutron star or a black hole. The core collapse releases a lot of energy which ignites fusion reactions in the lighter elements surrounding the core.
The fusion reactions in the layers around the core consume huge amounts of material very quickly. This causes the star to undergo a supernova explosion. The star shines very brightly for a short period of time.
What is left is the neutron star or black hole which was the core and a large cloud of material from the rest of the star.