About 5 billion years ago, a huge cloud of dust and gas in the galaxy collapsed under gravity. As it shrank and became denser, it began to glow and the first nuclear fusion reactions occurred, forming the Sun. Approximately 4.6 billion years later, the Sun has used half of its hydrogen fuel and nuclear reactions now involve carbon, nitrogen, and oxygen. In around 5 billion more years, the Sun will expand into a red giant and engulf the Earth before collapsing into a white dwarf.