The first shown ionic compound has only two elements, Li and F.
On a periodica table, we can see that Li is on the first group, so it is the metal one.
F is on the 17th group, so it is the nonmetal.
We have only one of each of them, so the formula will only have one of each.
The formula is:
And we have 1 of each, so their ratio is 1:1.