This paper discusses the enhancement of power quality in electrical systems using a fuzzy logic controller (FLC) based unified power flow controller (UPFC). It highlights the ability of UPFC to manage both active and reactive power flows while mitigating issues such as total harmonic distortion and voltage regulation. The study presents a comparative analysis with conventional PID controllers, showing improved response and stability with the FLC approach through simulation results.