Gerunds and infinitives are sometimes referred to as verb complements. They may function as subjects or objects in a sentence.
Both gerunds and infinitives can replace a noun as the object of a verb. Whether you use a gerund or an infinitive depends on the main verb in the sentence.
A gerund is a verb in its ing (present participle) form that functions as a noun that names an activity rather than a person or thing. Any action verb can be made into a gerund.
An infinitive is a verb form that acts as other parts of speech in a sentence. It is formed with to + base form of the verb. Ex: to buy, to work.