"Yesterday, he wrote a letter."
Translation:Hier, il a écrit une lettre.
He has written = Il + [present tense of avoir] + [present tense of écrire] = Il a écrit
The imperfect tense can be used to describe a past action that is either ongoing/reoccurring/incomplete. Hence, He was writing = Il écrivais.
Don't be discouraged; Duolingo is an immersive experience where you have to jump right in and figure things out when you haven't yet learned something.
The Imperfect Indicative is used to indicate:
An action that was going on in the past at the same time as another action. Example: Il lisait pendant que j'écrivais. = He was reading while I was writing.
An action that was going on in the past when another action occurred. Example: Il lisait quand je suis entré. = He was reading when I came in.
An action that a person did habitually in the past. Example: Nous allions à la plage tous les jours. = We used to go to the beach every day <or> We would go to the beach every day.
A description of a mental of physical condition in the past. Example (mental condition): Il était triste quand je l'ai vu = He was sad when I saw him. Example (physical condition): Quand ma mère était jeune, elle était belle = When my mother was young, she was beautiful.
An action or state of being that occurred in the past and lasted for a certain length of time prior to another past action. The action or state of being no longer exists. Example: J'attendais l'autobus depuis dix minutes quand il est arrivé. = I had been waiting for the bus for ten minutes when it arrived.
Source: Barron's 501 French Verbs