This is very easy if you assume you have 100g of the compound.
Do the metal last as it is unknown.
If you have 12% Carbon of 100 g , you have 12 g of Carbon = 1 mol C (Carbon's molar mass is 12)
Do the same with Oxygen. 48 g O/ O molar mass (16) = 3 mol O
Next, find a metal that has a molar mass of a multiple of 40. This has to be Calcium with a molar mass of ~40g. 40 g / 40 = 1 mol Ca
Put these together and your empirical formula is CaCO3