The passé composé is used for a one off event which happened in the near past and is now finished: a completed action. For example, j’ai joué au tennis la semaine dernière (meaning I played tennis last week: an action which is completed and finished and was a single event.) The imperfect is used for repeated or ongoing actions in the past, similar to the English ‘used to do’. For example, Quand j’etais petite, je jouais au tennis (meaning when I was little, I used to play tennis.)