Login loop in Kali linux 2021.4 [closed]

I have seen something like that in one of my own Kali machines.

Get to a Log in screen and use Ctrl-Alt-F1 to get to a terminal screen.

Run:

sudo apt-get update && sudo apt-get autoclean && sudo apt-get clean && sudo apt-get autoremove

Then restart and see if the machine now runs normally.

Kali is not very forgiving for some kinds of changes / errors. I have had to recover Kali machines from backups.

At this point, back up all your data and run the Kali installer again.

Follow up: For experimental work in Kali, I keep Kali as a virtual machine and these are easy to back up and recover from without reinstalling.