One possible version:
June 8, 20XX Dear Sir, I'm sorry to tell you that I can't go to school today, I've caught a cold because I swam in the school's swimming pool yesterday. This morning I had a headache. After taking my temperature, my mother found that I had a high fever, immediately she took me to see a doctor, who advised me to stay in bed for 2 days. Now I am writing to you to ask for 2 days' sick leave. With best wishes.
Dear Ms Yang,
I'm so sorry that I have got a cold.Because of the bad cold I can't go to school these days.As a result,I want to stay at home for days.Thank you.
Dear Mr/Ms XXX：
Today I'm writing to you to ask for a five-day leave, for I've got cold last night with carlessness.
This morning my mother took me to see the doctor,who told me to stay in bed for some days. So I am very sorry to be absent from school, especially your interesting lessons. I'll be sure to make up for the missed lessons after I recover from the illness.
I'm sorry to tell you that I caught a cold and I'm not feeling well now.I am adviced to stay in bed for two days and can't go to school then.But I think I'll get well soon and be back the day after tomorrow.