10 pm — I came home (starting point)
9:30 pm — My daughter went to bed
Some action happened in the past. For example, "I came home yesterday". This is our starting point on the timeline. Then, we have another action that completed before the first one started. For example, "When I came home, my daughter had already gone to bed."
So, we put the first action into the past simple and the second one which happened before — into the past perfect.
In sentences with "past simple + past perfect", we often use conjunctions like "when", "before" and "after".
Examples
Jacob decided to go to Africa after he had watched a documentary about the wildlife. 1) he watched a documentary; 2) he decided to go
I went straight to bed after the guests had left. 1) the guests left; 2) I went to bed
I hadn't truly loved anyone before I met you. 1) I didn't truly love anyone; 2) I met you
Had you consulted with your doctor before you started taking those pills? 1) you consulted; 2) you started taking the pills
Pay attention
If we have two actions in the past that happened one after one, like this
10:00 pm — I came home (starting point)
10:30 pm — I had a snack
then there is no need for the past perfect. We use the past simple tense for both actions. → I came home and had a snack.
The same is true for the actions that were happening at the same time. Like this
1:00 pm — I went shopping (starting point)
1:00 pm — My friends went to the cinema.
→ We arrived at the shopping centre. I went shopping, and my friends went to the cinema.