The particle で is used to indicate the place where an action occurs.チェンマイで、灯ろうを 空に 飛ばす 祭りが あります。
Noun + が + ありますN5
Sentence pattern used to express the existence of objects, events (not people, animals).チェンマイで、灯ろうを 空に 飛ばす 祭りが あります。
Dictionary form of verb + とN4
Sentence pattern used to indicate a condition, when one action occurs, another action will follow.夜に なると、たくさんの 灯ろうが 空に 上がります。
動詞て形 + くださいN5
This pattern is used to request someone to do something, in this passage it is expressed through the verb て (write and then do something).人は、灯ろうに 願いを 書いて、空に 飛ばします。