Diazepam is a benzodiazepine that has the potency to be misused because it is effective, easily obtained, and inexpensive. The misuse of diazepam is to replace illegal drugs and be a sedative. Separation of diazepam is needed to detect possible drug abuse and to monitor drug levels in blood to ensure the effectiveness of the drug. This study was conducted to obtain a molecularly imprinted solid-phase extraction (MI-SPE) sorbent to separate diazepam from serum samples. This work started at the synthesis stage with the bulk polymerization method, using methyl methacrylate and acrylamide as functional monomers, diazepam as a template, and ethylene glycol dimethacrylate as a crosslinker. The polymer obtained was identified by its adsorption capacity and packaged into a solid-phase extraction (SPE) cartridge, and the extraction conditions were optimized. The optimization results were then used to extract diazepam from the serum sample. The test results showed that the adsorption ability of the molecularly imprinted polymer (MIP) with the functional monomer, methyl methacrylate, was 63.98 ± 0.1%, which is higher than that of the acrylamide MIP monomer, with a value of 43.27 ± 0.1%. The MIP sorbent of methyl methacrylate was applied to the SPE with 200 mg of polymer in a 3 mL cartridge. Diazepam added to serum samples were then passed through the MIP-SPE producing a percent recovery value of 95.31 ± 1.1% for MIP and 60.83 ± 0.3% for nonimprinted polymer (NIP). The results showed that the MI-SPE sorbent made from the monomer methyl methacrylate gave higher extraction recovery results than acrylamide, and it could be used for extracting diazepam from serum samples with or without other substances.