This is a really difficult point in English. There are verbs that only take gerunds (for example, "enjoy swimming"), verbs that only take infinitives ("decide to quit"), and verbs that take both (like swimming / like to swim). And some verbs take both but the meaning changes. For example, "I stopped smoking" (I do not smoke anymore) vs. "I stopped to smoke" (I took a break and smoked a cigarette).
The same is true for expressions with adjectives and prepositions. Many of these only take gerunds: be interested in, look forward to, be open to, etc.
The bad news is there are no specific rules and you have to memorize all of these. ;(