Nouns ending in 'o' are generally masculine:
amico = friend (male)
libro = book
Nouns ending in 'a' are generally feminine:
amica = friend (female)
casa = house
Nouns ending in 'e' can be both and simply must be memorized:
ristorante (m) = restaurant
pane (m) = bread
classe (f) = class
notte (f) = night
Words ending with a consonant are usually foreign words, and are usually masculine:
bar, autobus, film, sport