ahah, I see that a lot of people are having some trouble understanding the difference, as well as i.
I went a bit more simple, here are the sentences I'm confused with:
j'ai encore écris lui, mon prof codagej'ai de la chance parce que il a [le répondu]/[répondu lui] il y a deux jourin the first sentence, I understand that I have to use indirect pronouns as I'm writing *to* [person]. However, this makes it kind of similar in the second sentence as he responded *to* it, but it can be easily confused with lui as I've already mentioned someone with the same type of subject? I'm just confused overall aaaa.