https://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.
sudo mount /dev/sdXY /mnt (in my case sudo mount /dev/nvme0n1p6)
Now bind the directories that grub needs access to to detect other operating systems, like so.