Can't login after trying to change desktop environment

I was trying to get Manjaro to run dwm, and I added a line to the bottom of .xinitrc that read

exec dwm

Then, after rebooting my system, I can’t log in. Every time I put in my password, it just puts me right back to the login screen. I know my username and password is correct, because I can Ctrl+Alt+F2 into the terminal and everything works just fine, but my desktop environment won’t load. I had Xfce installed before I tried to use dwm, but even after changing .xinitrc to match the default file based on the Manjaro Wiki, using exec startxfce4, it still won’t log in. I apologize for posting a question that is similar to others that have already been posed; I have no real idea what I’m doing. If anybody has any advice or can help me solve this problem, I’d be extremely grateful. Thank you.

.xinitrc is only when we boot on tty (without DM) and after we run startx

with lightdm, at us to create a /usr/share/xsessions/dwm.desktop and add /etc/lightdm/Xsession & in .xinitrc

Try to create a bootable USB with another computer or another OS if you have one instlalled in that PC and remove that line from the file. Best solution imo. I did something similar once, I had locked myself out of root access by making every root authentication fail, always, because of a single number.

I’ve already removed the line, because I figured that would solve the problem. It’s still not working, though.