There are several space mysteries that have been solved and remain unsolved, but scientists and astronomers have finally put one of the widely-discussed debates to rest about how our sun is going to die.

If the thought of our sun's demise has kept you up at night, this settles the score after nearly 25 years. The latest research, published in the journal Nature Astronomy, offers insight into sun's dramatic demise as a visible planetary nebula. The only setback is you (or anyone else for that matter) won't be around to see it.

One of the scientists involved in solving the years-long mystery, Albert Zijlstra, an astrophysics professor at Jodrell Bank, described the sun will die creating the most beautiful visual formation in the sky. Even though our sun is deemed a small star and some speculated that it won't be able to create a planetary nebula, scientists concluded that the sun has enough mass to create one.

Scientists may have discovered how magnetic waves heat the Sun
Scientists solved the mystery behind sun's demiseCreative Commons

Stars even a fraction smaller than the sun won't be able to produce a visible planetary nebula, but our sun will die to form a comparatively faint planetary nebula. Even so, Zijlstra noted that it would still be visible two million light years away if someone lived in the Andromeda.

"When a star dies it ejects a mass of gas and dust – known as its envelope – into space. The envelope can be as much as half the star's mass. This reveals the star's core, which by this point in the star's life is running out of fuel, eventually turning off and before finally dying," Zijlstra explained.

While our sun is just capable enough to form a planetary nebula, the envelope it forms will only shine for about 10,000 years, which isn't a long duration of time in astronomy. Only while the core is still hot, the envelope will shine – making it visible tens of millions of light years away.

Researchers used a computer model to conclude these new findings, which challenge earlier claims that our sun will simply fade away into the ether when it runs out of fuel, in this case, it is hydrogen. But it's not happening anytime soon.

As per the latest model, the stars heat up three times faster, which makes low mass stars such as our sun to form a bright planetary nebula.

The sun has already reached half its lifetime and it would take another 5 billion years before it collapses. When the sun's core will run out of hydrogen, nuclear reactions will take place outside the core, forming a red giant and expanding to 250 times its current size. This will engulf Mercury, Venus, and Earth, but our planet will long be inhabitable by then.

"We found that stars with mass less than 1.1 times the mass of the sun produce fainter nebula, and stars more massive than 3 solar masses brighter nebulae, but for the rest, the predicted brightness is very close to what had been observed. Problem solved, after 25 years!" Zijlstra concluded.