Custom error pages can be created from Cpanel, Error pages.
Once you create them you should create a .htaccess file in the public_html directory containing one of the lines below. If you already have a .htaccess file please add this line:
For custom 404 error page:
ErrorDocument 404 /404.shtml
For custom 500 error page:
ErrorDocument 500 /500.shtml