Good news for those already familiar with Pretérito Perfecto Compuesto: the principle is exactly the same. You take the auxiliary verb haber — only now not in the present tense, but in the imperfect — and add the participle of the main verb. That is all.
The forms of haber in the imperfect sound like this: había, habías, había, habíamos, habíais, habían. They are identical for all verbs without exception — which is a great convenience.
With participles everything is also logical. Verbs ending in -AR give up their ending and take -ado: llamar → llamado, trabajar → trabajado. Verbs ending in -ER and -IR receive -ido: beber → bebido, dormir → dormido. This rule works consistently — until irregular forms come along.
Irregular participles are a separate story. They cannot be calculated, they must be known. Memorise at least these: hecho (hacer), visto (ver), dicho (decir), puesto (poner), vuelto (volver), abierto (abrir), escrito (escribir), roto (romper), muerto (morir). A good way to reinforce them — use each one in a real sentence rather than simply cramming the list.