Tips for writing cover letters

I am completing an application form for a training contract and I have been asked to submit a cover letter with it.

I am therefore after some tips on the best format for a cover letter. Also, how long should it be – a couple of paragraphs or a little bit longer?