Nouns refer to things and ideas.
In Spanish, nouns have gender.
Nouns are either masculine or feminine.
The gender of the noun determines what articles we use in front of the noun.
Spanish has both definite and indefinite articles.
Definite articles refer to specific things.
Indefinite articles refer to unspecified things.
There is no rule to determine whether a noun is masculine or feminine.
However, most nouns that end in -o are masculine and most nouns that end in -a are feminine.
Be aware that there are exceptions to this rule, which you will need to memorize when you encounter them.