One day, I was on my Ubuntu PC and made the unfortunate decision to try uninstalling Python. That turned out to be a bad move. After rebooting the PC, I found myself stuck in a terminal without a UI, asking me to log in and specify the username.
Thankfully, I remembered my username and was able to log in, though I could have probably used the root account as well.
sudo apt install --reinstall gdm3 ubuntu-desktop gnome-shell After that I rebooted and was able to see my fancy UI again. https://support.system76.com/articles/login-loop-ubuntu/