Whilst both the imparfait and the passé composé refer to actions in the past, they are used in different situations. On the one hand, the imparfait is used in descriptions, to talk about a habit or a long action in the past. On the other hand, the passé composé is used for a finished and precise action in the past. For example, if you were to say "When the sun came out, Tom would get excited.", you would used the imparfait, as it refers to a habit. If you were to say "Tom ran up to his mother.", you would se the passé composé, as this refers to a past action, at a specific point in time.