Finding the cause when something fails.
ENABLE ERROR LOGGING
Never display errors on a production site; they expose file paths and query fragments. Log them instead.
In WordPress, enable WP_DEBUG with logging to file and display turned off. The log appears under wp-content.
In other applications, set the appropriate log level in configuration.
READ THE LOGS
cPanel > Metrics > Errors, or tail the error log over SSH while reproducing the problem.
The error usually names a file and a line, which is most of the diagnosis.
ISOLATE
Disable plugins or modules one at a time until the problem stops. That identifies the culprit even when the error message is unhelpful.
Switch to a default theme temporarily to rule out theme code.
CHECK WHAT CHANGED
Deployments, updates, configuration changes. Something changed, and it is usually recent.
PROFILING
For performance rather than errors, a profiling tool shows where time is spent. Query Monitor for WordPress, or the framework's own debug bar.
WHEN TO ASK US
Errors pointing at the server rather than your code, or resource limits you cannot explain.