Indicates what used to happen, such as habitual or repeated happenings:
cuando vivíamos en Barcelona, teníamos que hablar catalán.

Description – Madrid era más que un pueblo importante

To say what was happening at a particular time
Hablaba al téléfono

Continuous: Estaba hablando por téléfono cuando llamaron al puerta

2 sets of endings, one for -ar verbs and the other for -er and -ir verbs

trabajar comer vivir
trabajaba comía vivía
trabajabas comías vivías
trabajaba comía vivía
trabajábamos comíamos vivíamos
trabajabais comíais vivíais
trabajaban comían vivían

The verbs ser and it are irregular

ser ir
era iba
eras ibas
era iba
éramos íbamos
erais ibais
eran iban