Yesterday it was really frustrating. My personal laptop got messed up. I was not able to access the GUI but was able to access the terminal. Somehow, after trying different solutions for nearly 2 hours it got fixed.
I reinstalled Debian’s desktop environment via Tasksel. Finally, it worked.