If you are writing to someone whose name and title you do not know, use the greeting 'Dear Sir or Dear Madam, If you don't know the gender of the recipient use 'Dear Sir/madam' and end with 'Yours faithfully', signing yourself with your initials and surname.
If you are writing to a named person, address them as 'Dear Mr/Mrs/Miss/Ms' as appropriate and end 'Yours sincerely', followed by your first name and surname.
If you have met them or spoken to them by phone, or otherwise feel that you have some acquaintance with them, address them by their first name and sign yourself Yours sincerely, using your first name.
Here is a site with sample letters which might help:
AskOxford: Sample Letters