Remember that in ionic formulas, the cation, which is another name for positive ion, is written first, and the anion, or negative ion, follows.
If you apply this rule to potassium oxide, the cation will be
In the case of ionic compounds, the subscripts are written using the cross rule, which means you can work backwards to determine the charges on your cation and anion.
Here's an example of how to do that
If you start with the formula
This means that the negative ion will be
Take another example:
You can use this method for any ionic formula. Remember that the subscript of an atom is equal to the charge on the other atom. You can extend this method to polyatomic ions as well. Read more on that here: