The rule of thumb is that "like dissolves like". Polar/ionic solvents dissolve polar/ionic solutes and non-polar solvents dissolve non-polar solutes. For example, water is a polar solvent and it will dissolve salts and other polar molecules, but not non-polar molecules like oil.