The article in Italian is quite complex, because it has several forms.
Easy for feminine nouns: the articles are ”la/le” (singular/plural), but the singular form is elided to ”l’” when the following word (which is not necessarily the accompanying noun) starts with a vowel:
- la rana (the frog)
- l'amica (the female friend)
- la migliore amica (the best female friend)
- le amiche (the female friends)
For masculine nouns there are two pairs, namely “il/i” and ”lo/gli”. The forms “lo/gli” are used when the following word (not necessarily the accompanying noun) starts with
- any vowel (including i or u with consonantic value); in the case of a true vowel, the singular form is elided in “l’”
- z
- the digraph gn
- s followed by a consonant (even if it is a digraph such as “sc”)
- special initial groups not really belonging to Italian phonology such as “ps,pn,x”
In all other cases the forms “il/i” are used.
- l'amico (the male friend)
- il migliore amico (the best male friend)
- gli amici (the male friends)
- i migliori amici (the best male friends)
- lo zucchero (the sugar; well, in English the article is out of place)
- lo scimpanzè (the chimpanzee)
- lo gnomo (the elf), gli gnomi (the elves)
- lo studio (the study)
- gli studi
- lo scimpanzè (the chimpanzee)
- lo psicologo (the psychologist)
Note that “preposizioni articolate” follow the same usage.
Usage in the last case may vary and it's not infrequent to hear “il pneumatico” (the tire) despite grammars prescribe “lo pneumatico”.
Regional use also may differ: in my region we eat “i gnocchi” and in Verona they elect “il papà del gnocco” during Carnival.
In modern Italian, plural forms of the articles are never elided. In old texts you may find “gl'inviti” for “gli inviti” or “l'erbe” for “le erbe” (elision for “gli” used to be allowed only when in front of a vowel “i”).
Elision in front of consonantic “i” is a matter of taste; grammars might prescribe “l’iato”, I'd always say “lo iato”. Elision in front of consonantic “u” is the rule: “l'uomo, l’uovo”.
Foreign words starting with a glide, such as “whisky” have no standard rule: some say “il whisky” (I, among them), other say “l’whisky”.
For indeterminate articles, they are “un” (following the rules for “il”), “uno” (following the rules for “lo”, including elision) and “una” (following the rules for “la”).
How can you determine the gender of a noun? There is no rule, I'm afraid. We say “la matita” (but it can also be “il lapis”, not really common nowadays), in Spanish it is “el lápiz”; we say “il latte”, but it is “la leche” in Spanish.