"Le" is used when referring to a male, a person. Like "A Carlos se LE cayó la carpeta".
"La" is used when referring to a female or a feminin object.
"Lo" is used when referring to a something that's masculin but not a person.
I tried to explained as simple as possible, I hope it helps
It's difficult to explain hahaah I tried to make it simple, that should cover 95% of the cases