Certain verbs accept either a gerund or infinitive, each conveying distinct meanings.
Forget
- I think we forgot to lock the door when we left. (we forget to do it.)
 - I’ll never forget walking on that amazing beach for the first time. (the memories we will not forget.)
 
Remember
- He didn’t remember to turn off the heating after class. (need to do)
 - I remember eating on this same chair the day I graduated. (talk about memories)
 
Try
- I’ll try to convince him, but I’m not sure that’s going to change anything. (make an effort to achieve)
 - Why don’t you try drinking a glass of hot milk? (try something as an experiment to see if it helps)
 
Stop
- We had to stop to eat something and go to the toilet. (Stop doing something and start doing a different thing)
 - I need to stop smoking once and for ever. (Stop doing something)
 
Need
- I need to see you immediately. (it’s necessary to do)
 - Your car needs cleaning. (something needs to be done)
 
References