Solution:
To enable debug mode in WordPress, you can use the global variable WP_DEBUG in your wp-config.php file:
// Enable debugging
define( 'WP_DEBUG', true );
// Disable debugging
define( 'WP_DEBUG', false );
// Log errors to wp-content/debug.log
define( 'WP_DEBUG_LOG', true );
This will display errors (when enabled) and also save them to a debug.log file inside the /wp-content/ directory.