To ~ (Infinitive) and preposition + Gerund (-ing)

J. Afraid to (do) and afraid of (do)ing
a. I am afraid to do something = I don’t want to do it because it is dangerous or the result could be bad. We use afraid to do for things we do intentionally; we can choose to do them or not. (e.g. This part of town is dangerous. people are afraid to walk here at night. (= they don’t want to walk here because it is dangerous – so they don’t))

b. I am afraid of something happening = it is possible that something bad will happen (e.g. an accident) (e.g. The path was icy, so we walked very carefully. We were afraid of failing. (= it was possible that we would fail ~ not we were afraid of failing.))
c. So, you are afraid to do something because you are afraid of something happening as a result. (e.g. I was afraid to go near the dog because I was afraid of being bitten.)

J1. Interested in (do)ing and interested to (do)
a. I’m interested in doing something = I’m thinking of doing it, I would like to do it. (e.g. Let me know if you’re interested in joining the club. (not to join))

b. use interested to ~ to say how somebody reacts to what they hear/ see/ read/ learn/ know/ find: I was interested to hear it = I heard it and it was interesting for me. (e.g. I was interested to hear that Tanya has left her job.)
c. This structure is the same as surprised to ~/ glad to ~ etc. (e.g. I was surprised to hear that Tanya has left her job.)

J2. Sorry to (do) and sorry for/ about (do)ing
a. use sorry to ~ to say we regret something that happens (e.g. I was sorry to hear that Nicky lost her job. (= I was sorry when I heard that ~)

b. also say ‘sorry to ~’ to apologise at the time we do something. (e.g. I’m sorry to phone you so late, but I need to ask you something.)
c. can use sorry for or sorry about (doing something) to apologise for something you did before. (e.g. I’m sorry for (or about) shouting at you yesterday. (not sorry to shout))
d. can also say: I’m sorry I shouted at you yesterday.

J3. I want to (do)/ I’d like to (do) but I’m thinking of (do)ing/ I dream of (do)ing
a. I failed to (do) but I succeeded in (do)ing

b. I allowed them to (do) but I prevented them from (do)ing or I stopped them from (do)ing

J4. See somebody do and see somebody doing
a. I saw him do something = he did something (past simple) and I saw his. I saw the complete action from beginning to end. (e.g. he fell off the wall. I saw this. -> I saw him fall off the wall.)

b. I saw him doing something = he was doing something (past continuous) and I saw this. I saw him when he was in the middle of doing it. This does not mean that I saw the complete action. (e.g. He was walking along the street. or I saw this when I drove past in my car. -> I saw him walking along the street.)
c. Sometimes the difference is not important and you can use either form. (e.g. I’ve never seen her dance. or I’ve never seen her dancing,)
d. use these structure with see/ hear/ notice/ listen to/ smell/ find. (e.g. I didn’t hear you come in. (You come in – I didn’t hear this), I could hear it raining. (it was raining – I could hear it))

more about the Gerund (-ing) and to ~ (infinitive)