After shedding its outer layers and engulfing the inner planets during its red giant phase, the Sun will leave behind a white dwarf. The remaining material could potentially form a new planetary system around this white dwarf.