Biodiesel, touted as a viable alternative to fossil fuels, has attracted interest due to its environmentally friendly nature, renewability, and high combustion yield. This study utilized K2O/RGO heterogeneous catalyst for biodiesel production through the transesterification of sunflower and waste cooking oils. Reduced graphene oxide (RGO) was prepared from graphite via the modified Hummers' method and potassium was subsequently deposited on it. The K2O/RGO catalyst was characterized using a variety of techniques, including FTIR, SEM, XRD, ASAP, Raman spectroscopy, and TEM. The study further investigated the impacts of the temperature, molar ratio of methanol to oil, catalyst dose and time; and optimized the process with the response surface method. The characteristics of biodiesel fell within the ASTM D 6751 and EN 14214 standard ranges. The K2O/RGO catalyst demonstrated reusability for up to four cycles. Maximum biodiesel yields of 98.54% for sunflower oil and 96.89% for waste cooking oil were achieved under operating conditions of 70 °C temperature, 19.5 methanol to oil molar ratio, 2 wt.% catalyst dose, and 8.5 h time duration.