It's understandable to feel nervous about this! The truth is, it depends on the type of essay you're writing.
* For academic essays (IELTS, university papers, etc.), it's best to avoid most idioms because they are often informal. However, some "formal idioms" or "fixed expressions" (like "a case in point," "play a crucial role," or "in light of") can be acceptable in formal writing.
* For opinion or creative essays, idioms might be more acceptable if they are relevant and used correctly.
If you’re preparing for IELTS, you can safely use formal expressions, but avoid anything too casual.