To ~, for ~ and so that ~ (purpose)

H. use ‘to ~‘ to say why somebody does something (= the purpose of an action) (e.g. ‘Why are you going out?’ ‘To post a letter.’
a. use ‘to ~‘ to say why something exists (= its purpose) (e.g. This wall is to keep people out of the garden.)
b. use ‘to ~‘ to say what can be done or must be done with something. (e.g. It’s difficult to find a place to park in the centre. (= a place where you can park)) Also money/ time/ chance/ opportunity/ energy/ courage etc. to (do something) (e.g. They gave us some money to buy some food)

H1. ‘for + noun’ (e.g. I’m going to Spain for a holiday) vs. ‘to + verb’ (e.g. I’m going to Spain to learn Spanish. We can say ‘for (somebody) to (do something)’ (e.g. There weren’t any chairs for us to sit on, so we had to sit on the floor.)
a. can use ‘for -ing’ or ‘to ~’ to talk about the general purpose of something, or what it is generally used for. (e.g. Do you use this brush for washing the dishes? (or ~ to wash the dishes?))
b. can use What for? to ask about purpose (e.g. What is this switch for?)

H2. So that: sometimes you have to use so that for purpose. We use so that (not to ~) especially
a. when the purpose is negative (so that ~ won’t/ wouldn’t) (e.g. I hurried so that I wouldn’t be late. (= because I didn’t want to be late))
b. with can and could (so that ~ can/ could) (e.g. She’s learning English so that she can study in Canada.)

more about the Gerund (-ing) and to ~ (infinitive)