Both gerunds and infinitives are forms of verbs or verb phrases that can be used in a sentence as its subject or its complement, or as its object.
The two can be readily identified by their ending or beginning.
A gerund always ends in ing, while an infinitive is a verb phrase that begins with to.
"Gloria's desire, to teach English as a second language, was realized after her college graduation."
This sentence makes the object of Gloria's desire immediately evident, that being the verb phrase to teach used here as the object of the sentence. The noun or subject of the sentence is desire, modified by Gloria's, and the verb phrase is was realized.
If we read further along, we might see:
Teaching English had appealed to Gloria since grade school.
And here the gerund appears as Teaching ...