Ideally, you will personalize the letter with the name of the hiring manager. Be sure to spell the name correctly and use the proper salutation (e.g., Dear Ms. / Mr. / Dr. etc.). This is a formal letter, so use a colon rather than a comma after the salutation. If there is no contact name in the job posting, be creative about finding one - it will make you stand out. Look on the organization's web site or call. If you can't get a name, use something such as "Dear Hiring Manager" or "Dear Search Committee."
The opening paragraph should be brief and specific. Explain why you're writing, identify the job for which you are applying, and say how you heard about it. If you were referred by someone within/connected to the organization, mention that person's name and position/connection. Say why you are interested in this particular job and organization. (Avoid focusing on what you hope to learn or gain.)