When we study infinitives and gerunds, a few special verbs need some attention. They can be followed by both infinitives and gerunds, but the meanings are different.
“Try to do something” is different from “try doing something” in meaning. “Try to do something” means you make an effort to do something; “try doing something” means experimenting with something to see if it will work.
The doctor tried to save his life.
Here you have to use the infinitive because it means the doctor made an effort to save the patient’s life; he didn’t experiment with different ways that might have saved the victim’s life.
He tried using another method.
He experimented with different methods to see which one would work. Therefore, you need to use a gerund here, not an infinitive.
“Remember doing something” means you did something in the past and you remember it. If you “remember to do something,” you haven’t done it, but you will do it.
Remember to lock the door. (The door is unlocked; you need to lock it.)
I remember locking the door. (You locked the door, and you remember that you did it.)
I remember seeing Obama once. (You saw Obama in the past.)
I’ll remember to buy a gift for my wife. (You haven’t done it yet.)
“Forget” is like “remember” regarding the use of gerunds and infinitives.
I forgot telling her about it. (You told her about it, but you forgot you did it.)
I forgot to tell her about it. (You meant to tell her, but you didn’t.)
I forgot to bring an umbrella. (You didn’t bring an umbrella.)
I forgot bringing an umbrella. (You brought an umbrella, but you forgot that you did.)
I regret to tell you that … (You’re going to tell me something.)
I regret telling her the truth. (You told her the truth already.)
“Remember,” “forget,” and “regret” have one thing in common: An infinitive means something hasn’t happened yet, and a gerund means something already happened.