Hi Elisheva,
When you are writing the formula for an ionic chemical, the goal is for the ions to balance in proportions that make an overall neutral compound.
In the case of Na+ and O2-, since O has a charge of -2, you need 2 Na ions (with a charge of +1 each) to make a neutral compound. 2(+1) = 1(-2).
For Al3+ and Cl-, you need a ratio of 1 Al3+ : 3 Cl-.
Hope this helps. If not, feel free to reach out and we can schedule a time to keep working on this.