By 'detect' I really have no idea what you mean. If you're looking for a method to tell if something is polar then as stated above try dissolving it in known polar and non-polar solvents. Like dissolves like so polar solvents dissolve polar compounds and visa versa.
If however, you mean how do you tell if something is polar from its formula etc then you need to check the polarity of each bond in the compound.
If no bonds are polar then the substance is non-polar. However, if some are and some aren't or all the bonds are polar you would need to check the shape of the molecule to see if the polar bonds cancel or form a dipole through the compound.