When mentioning two different incidents that occurred at different time in the past, the first occurred among them is said in past perfect tense and the incident that occurred after that is said in simple past tense.
Sub + had + PP Verb + Obj
Example
- The patient has died before the doctor arrived
- When I reached the station the train had left.
- He had finished his work before he went away.
- I had read the novel before my friend came.
- My cousin came to see me after I had done my exercise.