Options A and C:
We use the phrase to + verb when we want to present the intention of an action.
For example, 'I took the train to save some money'.
In the phrase for + verb-ing, 'for' is a preposition that can either modify a verb or a noun. The phrase brings out the meaning 'what for' in relation to the noun or verb that it modifies.
For the given sentence, the phrase 'to + verb' (to get warm) is most suitable, as it expresses the intention of the action 'sat near the fire'.
'For' in 'for + getting warm' does not modify any verb or noun here.
Hence option A is correct and C is incorrect.
Option B is incorrect because we can't use both 'for' and 'to' in the phrase. They both refer to purpose and cause a repetition.
Option D is incorrect because the verb phrase has not been modified to fit into the sentence.