Answer:
The words "el" and "la" both mean "the" in Spanish. As you said, "el" is masculine and "la" is feminine. Just like in English, these words are used before a noun. In Spanish and other romantic languages, all nouns are gendered. For example, "zapato" means "shoe" in Spanish and is masculine. So, if I wanted to say "the shoe," I would say, "el zapato." Additionally, "flag" is "bandera" and is feminine. So, to say "the flag," you say, "la bandera."
One way to generally tell if a noun is masculine or feminine is the ending. Most words that end with -o are masculine, and most words that end with -a are feminine. However, this is not a rule that always works, there are many exceptions; additionally, there are some nouns that don't end in -o or -a, like verdad (which is feminine). One example of a word that breaks the rule is problema (along with all Spanish words that end with -ma). Problema ends with -a but is masculine. This means that "the problem" in Spanish is "el problema."