If you're accused of cheating on an online exam, first, you need to consider the specific allegation. Are you accused of using notes or online resources that were not supposed to have been used? Are you accused of collaborating with another student or other students? Are you accused of having going past, say, the allotted time? First, you have to consider, again, the specific allegation.
You also have to bear in mind that you cannot depend on the school to do the right thing. If you're being falsely accused you cannot depend on the professor, whomever proctored the exam, the online exam, the student conduct office. They're not in your corner. You have to take the necessary precautions before you engage with the school in any capacity. You have to prepare the necessary and proper response, and you have to plan accordingly for the school to not necessarily be receptive to that. That's the unfortunate reality when you're being accused of an academic misconduct case.
Having an experienced academic misconduct attorney advisor is going to be your best ally because they can help you protect your interests and your rights. They can also help you best navigate and understand the process. Then they should be involved as early as possible if you're accused of an academic misconduct charge involving an online exam.