'To whom it may concern,' - you don't know the department/person. You write to a company in general.
'Dear Sir or Madam, '- you don't know the name of the person.
'Dear Mr/Miss/Mrs [name],' - you know the name.
'Yours sincerely' - when you know the name and title of the person.
'Yours faithfully' - is the one to use when you do not know the person's name.
'Kind regards' - When you know/have met the person.