To use custom error messages on Drupal 8, follow these steps:
1. Log in to your Drupal 8 website as an administrator.
1. Go to the “Configuration” tab from the admin menu.
1. Click on the “System” option, and then select “Site information.”
1. Scroll down to the “Error pages” section, and click on the “Create custom error page” link.
1. Select the error you want to create a custom message for, such as “404 Not Found” or “403 Access Denied.”
1. Enter your custom message in the text box provided.
1. Click on the “Save configuration” button at the bottom of the page, and your custom error message will be displayed whenever that error occurs.
You can repeat these steps for any other errors you want to create custom messages for. Custom error messages can help improve the user experience of your website and make it easier for visitors to understand what’s happening when they encounter an error.