Fehling's test works by reacting a sample of the unknown compound with Fehling's solution, which is a mixture of copper(II) sulfate and sodium hydroxide. If the sample contains aldehydes or ketones, it will react with the copper ions in the solution to produce a brick-red precipitate, indicating the presence of a carbonyl group.