To explain ‘why’ someone does something, use a to-infinitive (NOT for): ‘She opened the door to let the cat out.’ In formal styles, ‘in order to’ can also be used: ‘UN troops have been sent to the troubled spot in order to restore peace.’
For never comes immediately in front of a to-infinitive. It should be (for+sb/sth+to-infinite): ‘It will be difficult for John to say no.’
Use for to explain ‘how long’: ‘He has not eaten anything for the last two days.’ But use over/ during/in to say ‘when’ (especially, when it indicates a long period of time): ‘She has been a great help to me in recent months.’