How do I get GRUB to remember my last booted operating system?

On Ubuntu 20.04:

-Edit your grub file:

/etc/default/grub

at the top, change the following line to look like this:

GRUB_DEAFULT=saved

and then ADD this missing line:

GRUB_SAVEDEFAULT=true

Save your changes and then run this command to update GRUB with the new values:

sudo update-grub

Viola!