For businesses doing ecommerce in a retail environment (especially B to C), changing product continuously creates a problem for search engines and for the business website’s users. If the site was successful in ranking for a detailed product (classic long tail phrases), those results will continue to draw traffic even after the product is withdrawn. Result: 404 errors.
Solution A: 301 permanent redirects. This post in Get Elastic blog takes on the issue of “leaking” link juice due to expired pages. A good solution is to redirect those expired links to a live page that closely matches the intent or content of the old one.
Solution B: Where 301′s are not possible (why?) or you’ve missed a page, your 404 page needs to be helpful to the visitor. I’ve written about Get Elastic’s take on 404 errors elsewhere, but here what you want is a page that helps the visitor find what they were looking for as closely as possible