This is one of those questions that doesn't have a straightforward answer and it is only through experience of the language that one learns the gender of each noun. However, there are some noun endings that make it clear which gender the noun is. For example, if a noun ends in 'tion' such as 'education', it is almost always feminine (la education). Another example is if a noun ends in 'ment' such as 'appartement', it is almost always masculine.Although there is no clear rule that makes the gender clear, there are some endings of nouns that may make their gender clear.