In the present study, the dye methylene blue (MB) was entrapped in an agarose gel and used as a sensing probe for the detection of total cholesterol. When methylene blue-entrapped agarose cubes were added to the cholesterol solution, methylene blue was displaced by cholesterol and released into the solution. A calibration curve was prepared by plotting the rate of release of methylene blue at 664 nm against varying cholesterol concentrations. A linear response was observed in the concentration range of 1 to 5 mM (40 mg/dL to 200 mg/dL) which covers normal and elevated cholesterol levels in humans. Optical detection of cholesterol using this dye-replacement method is simple, economical, and non-toxic. Characterisation of the system was carried out by FT-IR spectroscopy and cyclic voltammetry. The optical method was validated to determine total cholesterol in serum samples with reasonable accuracy.