Study some signal words for Past Perfect.
Words for Past Perfect:
before — перед тим, як;
after — після;
already — вже;
just — тільки-но;
for — протягом;
since — с тих пір;
till/until — до тих пір;
by the time — до того часу;
never — ніколи;
earlier — раніше;
when — коли;
yet — ще ні.
She knew how to cook a cake because she had made it earlier

James easily won this game because he had played it many times before

John had sat to work when his boss called for him. 

We had already bought a cake when Jill called us and told that she bought a cake too. 
I hadn’t served the table yet when the guests came.