A novel modified carbon ionic liquid electrode (CILE) is prepared as an electrochemical sensor for simultaneous determination of levodopa (l-Dopa) and melatonin (Mel). The experimental results suggest that a carbon ionic liquid electrode modified with multi-walled carbon nanotubes and cobalt hydroxide nanoparticles accelerates the electron transfer reactions of l-Dopa and Mel. The fabricated sensor revealed some advantages such as convenient preparation, good stability and high sensitivity. The DPV data in 0.1 M phosphate buffer solution (PBS) (pH 7.5) allowed a method to be developed for the determination of l-Dopa and Mel concentrations in the ranges 0.1–300 and 0.01–50 μM, with the detection limits of 0.075 and 0.004 μM, respectively. The proposed method was successfully applied to determinations of these compounds in some pharmaceutical and human urine samples.