Most system error messages may be edited by making changes to the language files. To find the message/file that you need to change, you can use the translation utility.
- For EE2: CP->Tools->Utilities->Translation Utility
- For EE3: CP->Developer->Utilities->CP Translation
I believe that is the EE way of doing things.
However, I would highly recommend that you use jQuery and the jQuery Validation library to handle your error messages inline or on the page instead of messing with EE's error pages. The EE error pages, while simple to use, do not really allow for fine grain modification. To me, it is much more user friendly to check validation during form input or on form submission and present a customized message and error highlighting so that the user knows right away what needs to be fixed and they don't have to jump between form and error page and back to fix it.
Furthermore, once you have the validation library working, you can quickly set up any form on input you need and validate the input with whatever requirements you have. Custom messages are easy to setup per form or per site.
Edit: since you seem to be wanting to customize the design and layout of the error page, you can do so a couple of different ways.
Edit the message templates found in the design user message section. Be sure to include the message tags that are specified there.
Use a user management extension like Solspace User or other similar mod that allows you to setup your own custom templates for redirection.