Both times describe an action in the past but it is really important to understand the difference. The passato prossimo describes a type of action that has happened only once in the past. It is formed by the conjugation of the auxiliary verbs avere (to have) or essere (to be) in the present plus the past participle of the verb we have to conjugate, for example fare (to do) in the past participle would be fatto (done).The action that the passato prossimo describes is momentary, with a brief length, an action that started and ended in the past.Example: Ieri sono andato al mare. (Yesterday I have been at the beach) We can identify the passato prossimo from the fact that the action happened only once in the past, I have been only once at the beach and this has happened yesterday.The imperfetto also describes a type of action that has happened int he past but it is an action that happens often and repeatedly. It is formed by the conjugation of the verb in question in the mode of imperfetto. For example, the verb fare (to do) declined would be facevo (did).It describes a type of action that has a longer length than the one described by the passato prossimo and that happens multiple times. It does not specify the beginning nor the end of the action.Example: Quand'ero giovane andavo al mare tutte le domeniche. (When I was young I went to the beach every Sunday) We can identify the imperfetto from the fact that the action has happened multiple times in the past. Here the indicator of time tutte le domeniche (every Sunday) helps us understand that this action has already taken place repeatedly in the past.