Retrieve the language
A to-infinitive clause can express purpose: We record stories to preserve them. It can follow a noun or adjective: a place to visit; ready to help. After an ordinal, superlative or only, it can modify a noun: the first student to arrive. Negation is not to: We agreed not to touch the artefacts. Match the implied actor and do not use for + bare infinitive to express purpose.
A perfect gerund (having + past participle) names an earlier action: She regretted having missed the open day. A perfect participle clause places an action before the main one: Having compared the courses, Mai chose one. The participle clause and main clause normally share a subject. Passive perfect forms are having been + past participle. Check chronology and avoid dangling subjects.
A cleft sentence highlights one part: Lan made the plan → It was Lan who/that made the plan. Focus on time: It was on Monday that Lan made it. Keep the original event, tense and actor unchanged. Who is possible for a person; that works in the other common focuses. Do not use a cleft to imply an unsupported contrast.