The Perfect 404 describes how to let your users know in a friendly way that they’ve found a broken link on your site and includes some good tips on what to do and what not to do when crafting your custom 404 page.
Another useful resource is this list of all HTTP error codes and what they mean, incase you want to write your own pages to handle other common HTTP errors.