I failed a written exam and I don't know how to reply to my professor
Tell the professor what happened.  If the professor already knows about your issues, there's no need to belabor them further.  If not, summarize as you did in your question here.

Explain that it was incomplete because, although you worked for the entire allotted time (if you did), you didn't finish.

Your question suggests that you may be used to an oral component on exams.  If that's the case, perhaps the professor would examine you by telephone, or Skype, or something.

The professor's email, as summarized by you, shows that the professor cares about you and wants you to do well.

Addendum: If you have academic trouble, always start with the professor.  If you get an answer you don't like, you can then move on to department heads, academic or disability services, etc.  Please give the professor a chance first.