1. Copy /templates/base/html/error.php (the base template file for errors) to your template folder at /templates/[yourTemplate]/html/error.php. This file renders the template for the error pages and will override the base file.
2. Copy the folder (and files) from /templates/base/html/errors to your template folder at /templates/[yourTemplate]/html/errors. You will need to copy the "errors" folder and each of the files it includes that you wish to adjust (401.php, 403.php, 404.php, 405.php, and default.php). These files generate the content of the individual error pages and will override the respective base error content files.
3. The last step is to make changes to the language files at /language/en-GB/en-GB.tpl_shiraz.ini. You will need to create a language file for your template if you are not using Shiraz, for example en-GB.tpl_[yourTemplate].ini.