How do you fix the message ‘There has been a critical error on this website’?

WordPress displays this message when its fatal error handler catches a serious PHP failure. The public notice hides technical details, while the server log usually contains the real error. Check the administrator email for a recovery-mode link, but verify the sender and domain before using any login link from a message.
Open the PHP error log and wp-content/debug.log if WordPress logging was enabled. Match the error timestamp with the failed request and read the earliest relevant fatal message. It often identifies a plugin, theme, custom snippet, incompatible PHP version, or missing function that needs attention.
Recovery Mode can pause the faulty component for the administrator session and allow access to the dashboard. If it is unavailable, disable the named plugin or theme through SFTP or the hosting file manager. Keep an installed default theme available so WordPress has a safe fallback when the active theme directory is renamed.
Update, replace, or correct the component on staging before returning it to production. A rollback to a recent working backup can restore service when several files or database changes are involved. Clear caches after the repair, test the action that triggered the failure, and remove debugging output from the live site once the logs are collected.