The AUR is an unsupported repository: the quality of the PKGBUILDS varies from the very good through to the abominably bad or outright negligent.
You should always read the PKGBUILD before attempting to install anything and look at the comments on the package page to satisfy yourself that there won't be any unforseen "surprises" when running
You should also not get in the habit of relying on an AUR helper to automate the build process for you and thereby blur the distinction between the officially supported repositories and the AUR.
If a particular PKGBUILD does not build successfully, the first step is to try and build it manually:
makepkg will provide meaningful error messages that should provide sufficient information to identify the issue.
Arch Linux is not like Ubuntu: users are expected to be able to read PKGBUILDs (basic bash scripts, essentially) and the
man page for
makepkg and understand the build process sufficiently to responsibly maintain their installations.
If the fault lies with the PKGBUILD, leave a comment to that effect on the package's AUR page to alert the maintainer and anyone else who may want to install the same package. If the issue goes unaddressed, you can always ask to have the package orphaned, then adopt it and fix the PKGBUILD so that it works as expected.
There are guidelines for maintaining packages on the Arch Wiki.