One can figure that out by looking at the differences in the properties of these states of matter. For example, solids have a definite shape, while liquids are somewhat more flexible and take the shape of the container they are in. Gases have no particular shape. Try to pour the unknown material. If it can be poured into another container with continuous flow, it is a liquid. If it falls into the other container in a single motion and retains the original shape, it is a solid. If it is difficult to transfer it into a container due to its shapeless state, then it is a gas. Another way to figure out which state this substance is in is to try to disturb it with air flow. Solid surfaces will not be disturbed by air flow, liquid surfaces will show waves or ripples (depending on their viscosity), while gaseous substances may simply blow away with air.
Hope this helps.