Before going to the main topic “how can a lipid be distinguished from a sugar”, you have to know what those are and what those are composed of. Lipid and sugar both are biomolecules and play important roles in their own way. However, sugar molecules are present in a polymeric form called polysaccharides while lipid molecules are not polymeric in nature.
The basic property that can answer the question of how can a lipid be distinguished from sugar is the hydrophobicity. You might ask what hydrophobicity is. To understand in a simple way, hydrophobicity or hydrophobic is a property of biomolecules that are insoluble in water and do not interact with water molecules. Such hydrophobic molecules tend to aggregate when placed in water or aqueous solvent. In the same way, there are biomolecules that are soluble in water and are able to interact with water molecules when placed in an aqueous environment.
Now, lets come to the point. So, how hydrophobicity helps us to distinguish a lipid from sugar. Sugars or carbohydrates which are polyhydric compounds. they are called carbohydrates because they are hydrates of carbon. If you see the empirical formula of carbohydrate you may see carbohydrates are represented as Cn(H2O)n. The presence of a hydroxy group on most of the carbon atoms makes the sugar molecule hydrophilic and all those -OH groups can form a Hydrogen bond with water molecules in an aqueous environment. That is why sugar molecules are soluble in water and all other polar solvents.
If you see the structure of a lipid, most of the lipids are composed of long-chain free fatty acids attached to glycerol through an ester linkage. Though there are some lipids such as glycolipids that contain sugar molecules and phospholipids that contain phosphate head group they are sparingly soluble or insoluble in water. The main reason behind the insolubility in the water is the hydrophobicity contributed by the free fatty acid residues.
Though an ester bond is polar and able to make a Hydrogen bond with water molecules, lipids are insoluble. The hydrophobicity contributed by free fatty acyl groups overweighs the polarity contributed by the ester bonds and, therefore, the overall result is the insolubility.