Naproxen works by inhibiting the activity of cyclooxygenase (COX) enzymes, specifically COX-1 and COX-2. These enzymes play a key role in the synthesis of prostaglandins, which are lipid compounds that contribute to inflammation, fever, and pain. By blocking these enzymes, naproxen reduces the production of prostaglandins, alleviating symptoms associated with inflammation and pain.