When do you know when to use, "el", "la", and, "le"?
Most nouns that end with -ma, a vowel with an accent (í, á ó etc...) a consonant that is not d or z and -o are usually masculine por ejemplo el problema, , el ají, el rumor y el acento
Most nouns that end with -ción, -d, -z and -a are usually feminine por ejemplo la investigación, la felicidad, la paz y la cosa
This site really helped me when I had the same question. As for the exceptions they will just have to be memorized you can do it! https://www.spanishdict.com/guide/masculine-and-feminine-nouns
As far as le it is what is called an indirect object pronoun and it replaces he she or formal you (usted) for example instead of saying Yo voy a dar un libro a él/ella/usted we can say Yo le voy a dar un libro or equally correct Yo voy a darle un libro Here is another source that may be helpful for you. https://www.spanishdict.com/guide/indirect-object-pronouns
I hope I made it clear for you :) ¡Que siga aprendiendo!