The main thing to keep in mind is that a 404 error page is just another web page. It is created in the usual way with HTML (and possibly CSS), and has the usual page structure, including <head> and <body> sections, and so on.
What makes it different is how you deploy it, and that depends on your web server. Often, it will have a designated name, such as 404.shtml, and will be located on the root directory. Check your server's documentation for specific details.
A good 404 page not only tells the visitor what has gone wrong, but gives useful links to other parts of the site (such as the home page or a site map) to help them find what they are looking for. Keep in mind that the visitor might arrive at the 404 from any sub-directory in the site, so you need to make these links absolute.