Trapassato prossimo

The indicative past perfect (or pluperfect) is used talking about the past to refer to an action which has happened before another past action.
Some examples:
Quando sono arrivato, il treno era già partito - When I arrived, the train had already left
La nonna raccontava sempre di quando aveva lavorato a Milano - My grandmother always told about the time she had worked in Milan
Avevo fame perché non avevo mangiato - I was hungry because I had not eaten
The indicative past perfect is formed by using the imperfect of the appropriate auxiliary verb (essere or avere) plus the past participle of the verb.
The table below offers an example of past perfect with both essere and avere as auxiliary verbs.

c1 c2
andare lavorare
io ero andato/a avevo lavorato
tu eri andato/a avevi lavorato
lui,lei era andato/a aveva lavorato
noi eravamo andati/e avevamo lavorato
voi eravate andati/e avevate lavorato
loro erano andati/e avevano lavorato