The formation of a single massive galaxy through time, from early cosmic epochs until the present day, in the TNG50 cosmic simulation. The main panel shows the density of the cosmic gas (high in white, low in black). Insets show large-scale dark matter and then gas (lower left), and small-scale stellar and gaseous distributions (lower right). This TNG50 galaxy will be similar in mass and shape to Andromeda (M31) by the time the movie reaches the current epoch. Its progenitor experiences rapid star formation in a turbulent gas reservoir which settles into an ordered disc after a couple of billion years of cosmic evolution. A rather quiet late time assembly history without major mergers allows the galaxy to relax into an equilibrium balance of gas outflows from supernova explosions and gas accretion from its surroundings.