The past perfect tense is used to represent past actions or states that were completed before other past actions or states.
The more recent past event is expressed in the simple past, and the earlier past event is expressed in the past perfect.
** Verbs in the past perfect tense take the helping verb “had”.
E.g. when I turned my computer on this morning, I realized that I had exited the program yesterday without saving my work.