A, in, da and di rarely map neatly onto English 'to, in, from, of' — or onto Persian «به، در، از». The good news is that each one follows a handful of clear patterns. Learn the pattern together with a real example, and the right preposition starts to come out on its own.
A and in: where you are and where you're going
- a + cities, for both being and going: Vivo a Roma. Vado a Milano.
- in + countries and regions: Abito in Italia. Andiamo in Toscana.
- in + many everyday places, without an article: in banca, in farmacia, in biblioteca, in cucina.
- a + a few fixed places: a casa, a scuola, a teatro — and al cinema (a + il).
Stasera sono a casa, ma domani vado in Spagna.
a casa (fixed place), in Spagna (country).
Da: from, at someone's place, and 'for/since'
- Coming from a place: Il treno arriva da Napoli.
- Going to or being at a person's home or shop: Vado da Marco. Sono dal medico.
- An action that started in the past and is still going on: Studio l'italiano da sei mesi — I've been studying Italian for six months.
Di: of, belonging, and where you're from
- Possession: il libro di Sara (Sara's book). Persian speakers can think of the ezafe: «کتابِ سارا».
- Origin with essere: Sono di Teheran. — I'm from Tehran.
- Contents and amounts: un bicchiere di vino, un chilo di mele.
One more thing to expect: these prepositions merge with the article that follows. a + il = al, da + il = dal, di + il = del, in + il = nel. Don't build these on the fly at first — learn them as ready-made chunks: al bar, dal medico, nel frigorifero.