Officially, AUR helpers such as yay are unsupported. The “proper” procedure involves manually building the package with makepkg.
Practically, most AUR helpers now simply automate the steps – some time ago, a few helpers actually added custom steps that could contribute to fail builds.
You can prefer using a AUR helper, though if a build fails, it may be worth trying the proper way.