Discovery of superconductivity in electride materials has been a topic of interest as their intrinsic electron-rich properties might suggest a considerable electron-phonon interaction. LayeredY2Cis a ferromagnetic quasi-two-dimensional electride with polarized anionic electrons confined in the interlayer space. In this theoretical study, we reportY2Cundergoes a series of structural phase transitions into two superconducting phases with estimatedTcof 9.2 and 21.0 K at 19 and 80 GPa, respectively, via the suppression of magnetism. Our extensive first-principles swarm structure searches identify that these two high-pressure superconducting phases possess an orthorhombicPnmaand a tetragonalI4/mstructures, respectively, where thePnmaphase is found to be a one-dimensional electride characterized by electron confinements in channel spaces of the crystal lattice, while the electride property inI4/mphase has been completely destroyed. We attribute the development of an unprecedentedly highTcsuperconductivity in Y-C system to the destructions of magnetism and the delocalization of interlayered anionic electrons under pressures. This work provides a unique example of pressure-induced collapse of magnetism at the onset of superconductivity in electride materials, along with the dramatic changes of electron-confinement topology in crystal lattices.