Before you begin to write, you should have the job posting and the hiring manager's name in front of you, and it wouldn't hurt to have a look at the company's website either. You're not writing a one-size-fits-all cover letter, so keep the specific information you need handy.
You should also have a look at application letter samples to identify the differences in approach and begin to form an idea of which would best suit you. Finally, use the specific points below to plan what you will focus on in your document.
Tailor your document to the job/company. The best letters are specific to the employer, so don't take the easy way out by using the same letter for every job application. Match your skills to the company's needs, and they'll be more likely to read your resume.
Demonstrate some knowledge of the company. Don't gush, but make the employer feel you're speaking to specifically to them.
Identify the top three requirements for the job. By repeating their own words back to them and then dovetailing your skills to fit their needs, you'll seem like a natural fit.
If you're initiating an unsolicited contact, show them you've done your homework. Explain you've got the experience to enhance the growth area that's important to the company.
Transferable skills are important. Whether you're considering a major career change or just a slight shift, your transferable skills should be described as desirable for the position.