Gender of nouns is a basic aspect of italian grammar. When you use an italian noun you need to know if it is masculine or femenine so that you can make other words that go with it masculine or feminine too. It’s a huge difference from what happened in English and in other languages that don’t use grammatical gender.
How to recognize what gender a noun is?
Regarding people and animals, grammatical gender is nearly always related to sex. It is much more difficult to define a rule regarding things: the choice between masculine or feminine seems to be totally arbitrary. The reason is historical. Italian nouns retain their gender from the Latin.
Generally, the letter a noun ends is a guide to its gender. Words ending in -o are nearly always masculine. Words ending in -a are nearly always femenine.
When a noun ends in -sione or -zione is femenine. For example, una occasione, una lezione. Almost all nouns ending in -tà and in tù are femenine.
Instead, words ending in a consonant are nearly always masculine: un film, un bar, uno sport. They are almost all nouns with a foreign origin.
Nouns ending in –i are femenine (if they are singular): la crisi, la diagnosi.
Words ending in -e can be masculine or femenine. For example caffè is masculine, while notte is femenine.
In this case, you have to remember the gender. A good way to avoid confusion is to learn words with their article: il caffè, la notte. With masculine noun you use il ora un, with femenine noun you use la or una.