How to avoid this problem:
Add the following to your bashrc/zshrc
#before every update, run
archinfo(){
yay -Pww
yay -Ps
}
#read the news and notice what packages that yay -Ps reports as orphaned. Either remove those packages or add the to the ignore list in pacman.conf, like:
#IgnorePkg = <orphaned package> <orphaned package>
#then, update
archupdate(){
#sudo reflector ...
yay -Syyu
#some other package manager, like cargo or cpanm
}