1. Wordpress has built in 404 and 403 template, it called in 404.php and 403.php in your template.

2. OR, You can also defined which page / action will load when specified error code sent by detected http response code, put this on your functions.php file:

<pre><code>function detect_response_header(){
    if (http_response_code() == 403) {
    // do some action here, include template file, redirect to outside    wordpress environment (file that not WordPress not involved in your site)  or whatever
    }
    }
    add_action('template_redirect','detect_response_header');
</code><pre>


ref:

https://codex.wordpress.org/Plugin_API/Action_Reference/init