Google has a video tutorial on how to set up the free Java text editor jEdit so that it will automatically validate KML as you type it in. Given how picky KML is about cases (capital letters) compared to HTML, this is a nice capability to have for both creating and debugging KML files. Now if someone would only create a KML plugin for jEdit …
The Google Outreach page has other great Google Earth tutorials:
Another option is to use the just announced KML Validator (http://www.kmlvalidator.com/home.htm). It is a free online service that checks your KML files against the new OGC KML 2.2 standard. Files can be uploaded or referenced from a URL. After checking the file it generates a report that outlines any issues and provides advice on how to resolve them.