This is a common question from all French students with no straightforward answer. This question can only fully be answered through experience and memorisation of the French nouns with their gender. However, there are a few endings in French that can make the gender clear. For example, if a noun ends in 'tion' such as 'education', it is almost always feminine. In contrast, if a verb ends in 'ment' such as 'appartement', it is almost always masculine. Learning the common endings such as these may help you get a good indication whether the noun is masculine or feminine.