Here are some ways to show why you did something, why something exists, or what its use is.
We put on lots of clothes to keep warm.
You have to study hard to be a doctor.
NOTICE: We also use in order to the same way.
We put on lots of clothes so that we wouldn't get cold.
I put it by the door so that I wouldn't forget it.
I took a taxi so that I'd arrive early.
I put it by the door because I didn't want to forget it.
I took a taxi because I wanted to arrive early.
NOTICE: We can give the purpose at the beginning of the sentence if we want to.
To be a doctor, you have to study hard.
Because I wanted to arrive early, I took a taxi.
The seats by the door are for the use of old people.
A pen is for writing with.
What did you do that for?
A barometer is a thing for measuring air pressure.
NOTICE: If there is a verb after for, it is the -ing form.