We use the gerund after...1. ... certain verbs, such as:
avoid, enjoy, like, love, prefer etc.
2. ... after prepositions, such as:
at, in, with, etc.
3. after some expressions, such as: look forward to...
We use the to infinitive after...
1. certain verbs, such as: agree, need, decide, choose, hope, want, would love, would like etc.