How to create 404 Error Page

Create a page

Create a new node of type Basic page

Add content

Use below sample code to create this page.

<div class="error-page">
<h1>ERROR 404</h1>
We are sorry, but the page you were looking for doesn't exist.
</div>

You have not successfully created Error 404 (Page Not Found) page.

Set this page as default Error 404 page

Navigate to: Administration >> Configuration >> System

admin/config/system/site-information

And set this page as your Error 404 page and click Save Configuration button.