You should know what are the 'functional group's' formulae, like chlorides being -Cl, carbonates -CO3 and so on.
Then, you have to know how to find the formulae of compounds given their valencies. These valencies, you'll have to learn I'm afraid. Try doing your question, and post your opinion and your explanation why you chose so and so. I'll help wherever you are stuck.