Both the preterite and imperfect tenses are past tenses in Spanish but they are used in separate ways.
Imperfect Tense
Habitual actions
"ing" e.g I was walking
what you were doing when interrupted by something else.
Preterite Tense
Actions at a given moment or time
past completed action
actions that interrupt another action
Both tenses can be used in the same sentence e.g I was walking when I heard a sound - Caminaba cuando escuché un sonido.