What you are talking about is called qualitative analysis. This is used to determine the presence of different ions in a solution. This is all based on precipitation and color. Different chemicals will either dissolve in water or not dissolve in water. If a chemical equation produces a product that is insoluble in water, the product will precipitate as a solid. For example, most chloride salts will dissolve in water except for silver chloride. This chemical is insoluble in water and will precipitate as a white solid. So chloride anion can be added to a solution to test for the presence of the silver cation. An example reaction is below:
AgNO3 (aq) + NaCl (aq) --> AgCl (s) + NaNO3 (aq)
Also, different ions will produce solids of specific colors. For example, copper salts tend to be blue colored and dichromates tend to be orange colored.
Unfortunately, there are really no systematic rules for precipitates or ion colors. They simply have to be remembered. The links below will show you numerous examples of both kinds.