You should first set up a Google webmaster account and submit an XML sitemap of your blog to ensure the Google 404 widget works effectively.
Add the following code to your 404.php template.
You could also add this code to your theme's index.php, single.php, image.php, archive.php and search.php below the HTML that is displayed if no posts are present (where you insert this may vary from theme to theme).




