In this work, we report a study examining how different salt concentrations affect the structure and electrochemical performance of two Co 3 O 4 /C materials designed for the fabrication of an easy, cheap, fast, safe, and useful electrochemical sensor for the detection of Palbociclib (PLB). Co 3 O 4 nanoparticles were successfully created by encapsulating them in N-doped amorphous carbon matrices by using the molten salt-assisted approach. In this process, different amounts of potassium iodate and zeolitic imidazolate framework-12 (ZIF-12) were used, followed by pyrolysis at 800 °C. Optimum Co 3 O 4 embedded porous carbon structures were obtained, and the composite with the highest electrochemical properties was modified to a glassy carbon electrode (GCE) surface for PLB detection. The linear response spanned from 1.0 to 5.0 μM, featuring a limit of detection (LOD) of 0.122 μM and a limit of quantification (LOQ) of 0.408 μM; the correlation coefficient was calculated as 0.995. The high sensitivity of the method in detecting PLB in pharmaceutical samples and human urine demonstrated its feasibility, with recovery percentages ranging from 99.3% to 101.3% and relative standard deviation (RSD) values of <3%. Therefore, this technique will make a significant contribution to monitoring and improving existing cancer treatment options.