Verbs followed by the TO-infinitive or gerund
Some verbs are followed by a to-infinitive, and others are followed by a gerund:
I wanted to ask you a question.
I insisted on leaving at once.
There are verbs that can be followed by either form with no difference in meaning. With some other verbs, the to-infinitive and the gerund have different meanings.