I am going to show you here below how to write an official resignation letter and to ask for a reference letter simultaneously. This is important because it will be stamped in your career path.
================================
[Insert date of letter writing]
[Address to your supervisor or department head]
Dear Mr. or Ms. xxxxx,
Re: Notice of Resignation
Due to my unexpected family problem, I feel sorry to tender my official resignation from my present position with effect from [insert the effective date].
I take this opportunity to thanking you for giving many valuable opportunities and supports to me during the course of employment.
I should be much obliged if you could provide me a reference letter before the date of my departure.
Yours faithfully,
[Insert your name as same as your HKID card shows] Please don't forget to sign the letter and keep a copy.