I'll preface this by saying I don't do stupid things on my main PCs but I do have a machine that I experiment with.
After doing a fresh minimal install of 24.04 on an old macbook air (no dual boot) I went to disable guest login by making a change in the lightdm.conf file and now the computer won't boot it just sits at the opening screen with mate logo.
After booting with the usb stick I used to install I can access the file and see what I did but I need root access (permission) to change what I did and this I do not know how to do.
It's not really all that important as I could just re-install but I'd like to learn from my mistake instead of taking the easy way out.
when you made a change in /etc/lightdm/lightdm.conf it implies you used sudo and your pw. You could boot your pc, press ESC to get to the grub page, select recovery and drop to a root shell and modify that file again.
if you boot from a live usb, your filesystem is not mounted. The live usb has a boot-repair option. Fix your boot, then mod that file. If you feel adventurous ...
sudo mount /dev/sda2 /mnt (your root partition).
sudo mount /dev/sda1 /mnt/boot/efi (your EFI partition, if UEFI).
Bind Mount: for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done