NSAIDs work by inhibiting the cyclooxygenase (COX) enzyme and preventing the synthesis of prostaglandins. This summary inhibition of prostaglandin synthesis is responsible for their analgesic, antipyretic and anti-inflammatory effects. However, it can also lead to unwanted side effects like gastric irritation. NSAIDs can be classified based on their structure and selectivity for the COX-1 or COX-2 isoenzyme. The document discusses the mechanism of action, classification, synthesis and structure-activity relationships of various NSAIDs.