Naproxen works by inhibiting cyclooxygenase (COX) enzymes, which play a crucial role in the formation of prostaglandins. Prostaglandins are responsible for causing inflammation, pain, and fever. By reducing the levels of prostaglandins, naproxen effectively alleviates these symptoms.