This is potentially one of the hardest parts of learning Spanish as a foreigner, especially as you are unable to convey the same meaning in the English language. These are both verbs referring to the past. The basic way to differentiate between the two is to look at the imperfective as an action that has occured many times in the past (routine) whilst the preterite is something that has only happened once. For example: Imperfect - Por la tarde me gustaba andar en la playa ( In the evenings I liked to walk along the beach) - it happened on more than one evening therefore requires the imperfect. Ayer por la mañana yo me fuí al mercado. - (yesterday morning I went to the market) - you are stating the exact time that it happened, implying it is a completed action that only occured in that moment.