First, a small admin request - Open all your IELTS threads in Writing Feedback forum which is the most appropriate forum for IELTS tasks :)
Dear Mr. Robert,
You are asked to write to a friend and therefore this letter comes under informal category. Here's some notes on that;
Formal;To someone you have not met, whose name you don't know ;
Opening Dear Sir / Madam ;
Ending Yours faithfully
Semi-formalTo someone you may or may not have met, whose last name you know & use;
OpeningDear Mr Brown,Dear Ms Stone;
EndingYours sincerely
InformalTo someone you know well, whose first name you know and use;
Opening Dear John/Dear Anita;
Ending Best regards/Warm wishes