To talk about actions that took place in the past we can use both El Pretérito Imperfecto and El Pretérito Indefinido.
Which one you need to use depends on whether you (or the speaker) consider the beginning and end of the action, or if you consider the action to be completed. This can be tricky for English speakers to understand because both tenses are usually translated the same in English.
El Pretérito Imperfecto for actions in the past with no clear beginning and end.
El Pretérito Indefinido for actions in the past with a clear beginning and end.
Let's have a look at these examples:
Susana trabajó muy duro.Susana worked very hard.
Trabajaba = we can see Susana working.
Trabajó = we can see Susana when she finished her work.
Los chicos corrieron por los pasillos haciendo ruido.The boys ran along the corridors making noise.
Corrían = we can see the boys running.
Corrieron = we see the empty corridors after the boys ran.
Antonio comió un bocadillo a mediodía.Antonio had a sandwich at midday.
Comía = we can see Antonio eating his sandwich.
Comió = we can see Antonio throwing his sandwich wrapper away.