Okay so let's start with verbs and to-infinitives. For example: This tool is used for opening ** or **This tool is used to open Which would be correct and why? I know that the to-infinitives are used to show the purpose of something and someone's opinion about something. But for is actually used for the same thing Isn't it? For example: I've got something for reading and I've got something to read I've been told that the first one sounds unnatural. But how do you determine this? I just can't understand it.
There are not general rules (or if there are, they are so weak as to be nearly useless).
Most of the time it is a matter of what kind of complement the particular head-word (verb, adjective, noun etc) requires, and I'm afraid that is simply a matter of learning.
So used can take either a to-infinitive clause or for followed by a noun phrase (which can be a gerund phrase).
Happy, on the other hand, can take a to-infinitive clause (I'm happy to try it), or about with a noun phrase (I'm happy about the result), but not for with a noun phrase (not *I'm happy for trying it) - except for the variant of a to-infinitive clause where the subject is expressed with for: I'm happy for him to try it.
Up is commonly used in speech to mean willing, ready, and can take for with a noun phrase, but not a to-infinitive clause: I'm up for leaving now, but not *I'm up to leave now.