to understand preposizioni ariticolare you have to have clear what article you must use for the noun you are using.
As you can see from this chart https://www.mappe-scuola.com/posts/preposizioniarticolate.php
an articulated preposition is so called because it is the union of a simple preposition (di, a, da, in, con, su, per, tra/fra) with an article.
Here is the rule for determinative articles (il, lo, la, l', i, gli, le)
1. "La casa del mio amico" (the article before MIO is IL, so DI+IL= DEL)
2. "La casa dell'amico" (the article before amico is L', so DI+L'= DELL')