Create a 404.html file in your document root. Detailed documentation is available.
Note Microsoft has changed recent versions of Internet Explorer to ignore custom error messages unless they are at least 512 Bytes in size, make sure your custom error message is at least this size.