The preterite tense is used for one-off or completed actions in the past. For example: Visitó España el año pasado. / She visited Spain last year.
The imperfect tense is used for repeated or continuous actions in the past. In English this can be translated as 'used to do something' or 'was/were doing something'. For example: Cuando era pequeña visitaba mi abuela cada verano. / When I was little I used to visit my grandma every summer. Comía mi cena cuando mi padre llegó a la casa. / I was eating dinner when my dad arrived home.