Astronomers believe the Sun (and the planets) formed around 4.59 billion years ago from the solar nebula. The Sun is currently in the main sequence, slowly depleting its hydrogen fuel supply. However, the Sun will eventually enter the red giant phase, where it will swell to consume the inner planets, including Earth, in about 5 billion years (probably). It will shed its outer layers before contracting to the size of a white dwarf.