In Spanish, as in many other languages, we find that words can be feminine or masculine. The general rule is that when the word’s ending is -a is feminine and when the word’s ending is -o masculine … but this is Spanish my friend and, as usual, there are exceptions!
In the picture you will find an infographic with the general rules and exceptions, as well as a reminder of the artículos determinados and a tip for when you do not know what gender a word is.