You already build this: had + the past participle — the same participle you use after have/has. That does not change here. Run the irregular ones through once, because from now on they turn up inside longer stories, where you have less time to stop and think.
A quick check: had + the past participle
Regular: walk → walked, play → played, watch → watched.
Spelling: use → used (add -d), study → studied (y → ied), stop → stopped (double the last letter).
Irregular (learn these): go → gone, eat → eaten, see → seen, write → written, take → taken, leave → left, do → done.
In use: They had walked home. / She had studied all night. / He had gone out.
Try it: The base verb is write (it's irregular). Finish the sentence: By 9 p.m. she had ___ the report. (written / wrote / writed / wroten) Answer: written — Write is irregular, so its past participle is written. Wrote is the plain past (I wrote it), not the past participle, and writed just adds -ed to an irregular verb. After had, use the past participle: had written.
The story does not always run in order
You already know the earlier action takes had + the past participle. What is new here is that a story often tells the later event first and then steps back, like this: Sofia woke up late. She had forgotten to set her alarm. Nothing in the order tells you which came first — had does.
Lars was annoyed. His bus had left two minutes early. (the bus left first)
The kitchen was a mess. Someone had cooked and not cleaned up. (the cooking came first)
When I arrived, the film had started. (one sentence, same idea)
Not "I had seen him yesterday." — say "I saw him yesterday.". For a single past event, just use the plain past (saw). Save had + past participle for the earlier of two things.
Try it: Two past things: first the train left, and then (later) Amina reached the platform. Which fits the thing that happened first? (The train had left when she reached the platform. / The train left when she reached the platform.) Answer: The train had left when she reached the platform. — The train left before she got there, so mark the earlier one with had + the past participle: The train had left. "The train left when she reached the platform" sounds like it left at the same moment she arrived, but it had already gone.
Negatives and questions inside a longer story
These are the forms you already met: hadn't + the past participle, and Had + subject + the past participle ...? for a question. What is new is spotting them where they are harder to see — in a sentence that already carries another past verb, like this: She hadn't finished when the bell rang.
Negative: We hadn't eaten, so we were still hungry.
Negative: She hadn't finished when the bell rang.
Question: Had you seen the film before?
Question: Had they left by the time you arrived?
Not "She didn't had left before I arrived." — say "She hadn't left before I arrived.". There is only ONE had, and it carries the tense: hadn't + past participle. Never use did/didn't with it.
Try it: Put the words in order to ask the question: did she leave before you called? Answer: Had she left before you called? — For a past-perfect question, had moves to the front, then the subject, then the past participle: Had she left ...? Not Did she leave... (that's plain past) and not She had left? — the had must come first.
Explaining why something was so
Use had + the past participle with because to explain a past feeling or result by something that happened before it. With because the plain past is also correct — the word because already tells you which came first — so had + the past participle is a choice you make to stress that the earlier thing was finished by then, not a rule you have to follow.
I wasn't hungry because I had eaten.
She was tired because she had worked all day.
We couldn't get in because we had lost the key.
Both work: We couldn't get in because we lost the key. / … because we had lost the key.
Try it: Hiroshi wasn't hungry at dinner. He wants to stress that the big lunch was already finished and sitting heavy by the time dinner came round. Both are correct English. Which one stresses that the lunch was already finished by then? (He wasn't hungry because he had eaten a big lunch. / He wasn't hungry because he ate a big lunch.) Answer: He wasn't hungry because he had eaten a big lunch. — Both sentences are correct, and because already tells you the lunch came first — so this is about emphasis, not right and wrong. Had eaten puts the spotlight on the lunch being finished and done by dinner time, which is what he wants to stress. Because he ate is the ordinary way to say it and would be perfectly natural too.