NSAIDs function by inhibiting the activity of cyclooxygenase (COX) enzymesâspecifically COX-1 and COX-2. These enzymes play a crucial role in the synthesis of prostaglandins, which are lipid compounds that promote inflammation, pain, and fever. By blocking COX enzymes, NSAIDs effectively reduce these symptoms.