yay calls pacman so to update your system all you need to type is:
yay
That will update both repo packages and AUR packages.
The same package name isn’t allowed to exist in both AUR and the repos. If you install using an explicit packagename such as yay -S steam, it will install it steam from the repos because a package of that name cannot also be in AUR.
However, if you type yay steam it will search both the repos and AUR for packages related to each and let you pick. However, it clearly shows which ones are in the repos and which are in AUR.
So for example, yay -S steam and sudo pacman -S steam will do the exact same thing. However, yay -S btrfs-assistant and sudo pacman -S btrfs-assistant won’t have the same effect. Because btrfs-asssitant is only in AUR, you can’t install it with pacman, that command will fail.
It is worth noting that you never use sudo with yay.
Simply running yay will handle it. It first calls pacman to update your repo packages and then updates your AUR packages. Even when you use yay, it is using pacman to install your packages.
You should use -Syu. However, with yay you don’t need either, you can simply type yay
Yes, yay uses the same syntax as pacman. However, yay has additional options in addition to pacman.