This paper investigates the efficiency and processes behind the photocatalytic degradation of Methylene Blue (MB) using BaTiO3, Sm@BaTiO3, and Sm@Ag@BaTiO3 nanoparticles (NPs). PXRD analysis revealed that cubic phase BaTiO3 NPs have mean crystallite sizes of 36, 48, and 57 nm, respectively. The band gap energies of BaTiO3, Sm@BaTiO3, and Sm@Ag@BaTiO3 NPs, computed from UV–Vis spectra, are 3.73 eV, 3.69 eV, and 3.65 eV. FESEM analysis determined the spherical shape morphology of the produced NPs. Among the samples Sm@Ag@BaTiO3 NPs demonstrated superior photocatalytic activity in degrading MB dye under UV light irradiation, achieving a dye degradation efficiency of approximately 83.20 %. The prepared nanoparticles showed significant consistency in reducing MB dye after four consecutive cycles, indicating their potential for repeated use. Our study demonstrates that green-synthesized BaTiO3, Sm@BaTiO3, and Sm@Ag@BaTiO3 NPs exhibit superior photocatalytic activity under visible light irradiation, effectively degrading MB dye. The trans-esterification process was influenced by several reaction parameters, including the molar ratio of alcohol to oil (4:1), the catalyst quantity (100 mg), the reaction duration (60 min), and the temperature (80 °C). Under these optimized conditions, the biodiesel yield reached a maximum of 91 % at 80 °C for 60 min in the presence of 0.5 M Sm@Ag@BaTiO3 NPs. Moreover, the catalyst demonstrated consistent performance across at least five runs and maintained effectiveness even after eight runs. These findings suggest that the catalyst has significant potential for producing biodiesel efficiently and cost-effectively under suitable reaction conditions.