404 errors in Webmasters Tools are usually caused in these circumstances:-
1. The URL existing before but no longer available.
2. The URL is still present in your sitemap buy showing errors when visited by search bots.
3. Some other external site is linking to that URL.
You can avoid these by these steps:-
1. Simply going to Webmaster Tools account -> Your Site -> Google Index -> Remove URLs. Here enter URLs that are showing 404 error in webmasters.
2. Make sure these URLs are not present in your sitemap so double check your sitemap again.
3. The third above circumstance might probably be out of your control to remove. If you have followed first 2 steps but errors are still coming due to 3rd, then you can simply ignore such errors.
I hope it helped.