Background or event?
Italian has two everyday past tenses. Which one you pick does not depend on when something happened, but on how you tell it. English does not help much here: "I played" can mean either one.
Imperfetto
Habit: what you used to do regularly
Description and state: what someone or something was like, including weather and age
An action in progress, with no start or end ("was doing")
Da bambino giocavo sempre a calcio.
As a child, I always played football.
La casa era grande e silenziosa.
The house was big and quiet.
Often a hint for the imperfetto: sempre, di solito, ogni giorno, mentre. English "used to" and "was/were -ing" also point to it.
Passato prossimo
A single, finished event, even if it lasted a limited time
A sequence of events: what happened next
Marco è arrivato alle otto.
Marco arrived at eight.
Ho aperto la porta e sono uscito.
I opened the door and went out.
Often a hint for the passato prossimo: ieri, due giorni fa, improvvisamente, poi.
Same verb, different message
Imperfetto
Da bambino giocavo a calcio.
As a child I used to play football.
Abitavo a Roma.
I lived in Rome at the time.
Passato prossimo
Ieri ho giocato a calcio.
Yesterday I played football.
Ho abitato a Roma per due anni.
I lived in Rome for two years (that is over).
Both in one sentence
They often appear together: the imperfetto sets the scene, and the passato prossimo gives the event that interrupts it. After mentre (while), the imperfetto is the usual choice.
Mentre guardavo la TV, ha suonato il telefono.
While I was watching TV, the phone rang.
guardavo = background, ha suonato = event
Faceva freddo quando siamo usciti.
It was cold when we went out.
faceva = state, siamo usciti = event