What is the procedure to be followed if any package compilation fails in YOCTO

Try to clean the package and re-build it using the below command:
bitbake -c cleanall <package_name>
bitbake -k <package_name>
Ex:
bitbake -c cleanall linux-iwg
bitbake -k linux-iwg