We use the past perfect (had + past participle) for something that happened before another moment in the past: When we arrived, the movie had started.
coral = the form we learnunderline = the word that decides it
Pattern
Examples

When we arrived, the movie had already started.

By the time I got to the stop, the bus had left.

She had never seen the sea before that trip.

I couldn't get in because I had lost my keys.

The street was wet. It had rained in the night.

After he had finished his homework, he went out to play.

When I opened the fridge, someone had eaten my cake.

They hadn't seen each other for ten years.
Remember
- The past perfect is the earlier action: first the bus had left, then I arrived.
- Had is the same for everyone: I had, she had, they had.
- Words like already, never and by the time often go with the past perfect.
- With before and after, the order is already clear, so the past simple is often enough: After he finished, he left.
Check yourself
Choose the right word. You'll see why after each answer.
When I got home, my sister ___ dinner.
✓ When I got home, my sister had cooked dinner. She cooked before I got home: had cooked.
The plane ___ when we got to the airport.
✓ The plane had left when we got to the airport. First the plane left, then we got there: had left.
I was hungry because I ___ breakfast.
✓ I was hungry because I hadn't eaten breakfast. Not eating came before being hungry: hadn't eaten.
By the time the police came, the thief ___.
✓ By the time the police came, the thief had escaped. By the time + past: the earlier action is had escaped.
She ___ never flown before her trip to Spain.
✓ She had never flown before her trip to Spain. Before a past trip: had never flown.
What next?
Keep going: pick your next step
Next rulePast Perfect ContinuousIntermediate · B2
Read a storyThe Story of HanukkahIntermediate · B1
Learn an idiomKeep a Secret, Tell a Secret: IdiomsIntermediate · B1
Learn new wordsAt the AirportIntermediate · B1
Popular hereVerbs with Prepositions followed by GerundsIntermediate · B2
Popular herePrepositions of Travel and MovementIntermediate · B1