To express purpose, use "to" before a verb (infinitive). Use "for" before a noun. When talking about what someone does, don't use the "for + veb-ing" construction.
To express purpose, use "to" before a verb (infinitive).
She went to the store to buy milk.
She went to the store for buy milk.
Use "for" before a noun.
She went to the store for milk.
I read mystery books for pleasure.
When talking about what someone does, don't use the "for + veb-ing" construction.
I read technical books to expand my knowledge.
I read technical books for expanding my knowledge.
However, when talking about the purpose of an action or object, we typically use for + veb-ing. You can also introduce this pattern to describe the function of an object.
This is a program for helping the elderly.
Scissors are used for cutting thin materials.
If the subject of the sentence is a person, the "to + infinitive" construction is also correct with these sentences.
She has created a new program to help the elderly.
Olivia used a pair of scissors to cut her nails.
You can use "in order to" instead of "to". Both "to" and "in order to" are prepositions that have an infinitive as its object. "In order to" is more formal and explicit than "to" by itself. For example, you can use "in order to" to show emphasis or in formal writing.