ABSTRACT Relic galaxies are massive compact quiescent galaxies that formed at high-redshift and remained almost unchanged since then. In this work, we search for analogues to relic galaxies in the TNG50 cosmological simulations to understand relic formation and test the ability of TNG50 to reproduce such rare objects. Using stellar mass, age, radius, quiescence, and stellar assembly criteria, we find five subhaloes in TNG50 that could be potential relic analogues. We compare their properties with other constraints imposed by a sample of 13 observed relic galaxies. We find one analogue in TNG50 that simultaneously satisfies most of the available observational constraints, such as metallicity and morphology. It also shows similarities to the confirmed relic NGC 1277, regarding environment and dark matter fraction. By taking into account a degree of relicness, a second relic analogue may also be considered. However, the central parts of the brightness and density profiles of the analogues are less steep than that of real relic galaxies, possibly due to limited numerical resolution. We identify two formation pathways of relic analogues in TNG50 depending on their environment: they either have their remaining gas stripped during the infall into a cluster at z ≲ 1.2 or consume it before z > 1.5. They are then deprived of significant star formation, leaving their stellar populations almost unaltered during the last 9 Gyr. We also find that the analogue progenitors at z ∼ 4 inhabit more massive haloes than progenitors of quiescent galaxies with similar stellar mass at z ∼ 0.