I forgot to buy the milk has a different meaning than I forgot buying the milk.
The former means that I don't have milk and the later means that I have milk, I just don't remember buying it.
The -ing form is used with all progressive forms of verbs--simple and perfect--and with present participle.
I think your textbook is referring to verbals called gerunds and infinitives.
A gerund is the -ing form of a verb functioning as a noun. An infinitive can also function as a noun and is usually preceeded by the word to.
Some verbs can use either one. Like the word go. We can say, "We will go shopping after work, or we can go to see a movie."
Some verbs have to have either a gerund or an infinitive. They're not interchangable.
Gerund: "He considered calling me." Not "He considered to call me."
Infinitive: "He decided to wait." Not "He decided waiting."
Here's a link to an article that might help.
Verbals: Gerunds, Participles, and Infinitives