1- Remove yay by running
$ sudo pacman -R yay
2- Make a new directory and change to it (makes for easier cleanup):
$ mkdir /tmp/yay && cd /tmp/yay
3- Download the latest PKGBUILD for yay by running
$ curl -OJ 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yay'
4- Build and install the package by running
$ makepkg -si
5- Get rid of of the evidence:
$ rm -rf /tmp/yay