so you're in the grub shell, right? “can't find vmlinuz you have to load the linux kernel” or something?

ls

should show you stuff like

(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) 

you don't have to include the gpt, going forward.

in turn, ls each partition:

ls (hd0,1)
ls (hd0,2)
ls (hd0,3)

one of them should tell you Filesystem type ext* - that's your linux filesystem. hopefully. Let's look inside it:

ls (hd0,2)/

that trailing slash is vital.

ok, did it show you a bunch of directories, including /boot?

also:

cat (hd0,2)/etc/issue

should tell you your OS's name. Might be important info if you're dual booting.

ls (hd0,2)/boot

you should see vmlinuz-(etc) (let's say vmlinuz-6.2.0-20-generic) and initrd(something).img(maybe something) (let's say initrd.img-6.2.0-20-generic).

Good shit: this is our drive.

set root=(hd0,2)
linux /boot/vmlinuz-6.2.0-20-generic root=/dev/sda2
initrd /boot/initrd.img-6.2.0-20-generic
boot

linux must have root=(device). if you fuck that up, reboot.

ideally you're in your operating system now. You'll have to update the bootloader. there's a great program (that somehow isn't installed by default??) to handle this automatically: update-grub. install it, sudo run it.