Discuss and learn French: French vocabulary, French grammar, French culture etc.
Here are some rules. They have some exceptions but they'll probably help you.
Nouns in -age (except image, nage, rage, etc..) in -al, -ail,-ement,-eil,-eur(if they speak about an object, an activity, a work, a speciality) are masculine.
It's same thing for noun finished by -illon, -ier, -isme, -in, -is (except fin, brebis,oasis,souris,etc...).
Names of metals or trees are masculine (except some small trees or vegetals la vigne, l'aubépine,...)
Nouns finished by -aison, -ande, -aine, -esse, -aie, -aille, -eille, -ille are feminine (except quadrille, braille, trille,...)
It's the same thing for nouns finished by -ance, -ence (except silence), -ade(except jade,...),-ée (except lycée, musée,...)
Abstract nouns finished by -eur (except bonheur, honneur,...) -ité(except past participle), -ie(except génie, incendie,...), -tion, -ation, -otion, -ution (except bastion,....) are feminine.
Nouns finished by -ure (except bromure, cyanure, murmure,...) are feminine.
Name of sciences, except le droit, are feminine.
As you can see there are several exceptions. The best way is to learn the gender with the noun.
But if you speak with French people and you switch the gender they will generaly understand you.
You may like to look at the grammar section page on When to use 'le' or 'la', which gives some of the patterns for determining the gender of French nouns.
However, if you're just starting out with French, for the time being there is also an argument that it's easier to just remember which gender a noun is than to learn the complexities of the various patterns. As your French vocabulary grows, and you're acquiring more vocabulary from "natural" reading rather than from vocabulary books, then knowing the patterns will be more important.