Enable WordPress debugging
WP_DEBUG is a PHP constant (a permanent global variable) that can be used to trigger the "debug" mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file on development copies of WordPress.
Check the Error log first
Before enabling WP_DEBUG, check the Error log in the Logs tab of the Templ Panel - no setup required, and it already captures PHP errors and warnings.
Only enable WP_DEBUG when you need more detail than the error log shows, such as WordPress notices and deprecation warnings.
Enable WP_DEBUG in wp-config.php
In the root folder of your website, find the wp-config.php file and add the following lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
/* That's all, stop editing! Happy publishing. */ in the wp-config.php file.When WP_DEBUG_LOG is set to true, the log is saved to wp-content/debug.log.
Keep WP_DEBUG_DISPLAY set to false on a live site so PHP errors are written to the log instead of being shown to your visitors.
Only set it to true on a staging site where you want errors printed directly on the page.
Source & more info: Debugging in WordPress