The imparfait is formed from the nous form of the present tense: drop the -ons ending and add -ais, -ais, -ait, -ions, -iez, -aient. From nous parlons, you get je parlais, tu parlais, il parlait, nous parlions, vous parliez, ils parlaient. This rule works for nearly every French verb, including most irregular ones.
Être is the one true exception, since its stem isn't derived from a present-tense nous form: j'étais, tu étais, il était, nous étions, vous étiez, ils étaient. Verbs like manger and commencer keep a spelling adjustment (mangeais, commençais) in the forms where the ending would otherwise make the g or c sound hard.