An NSAID works by inhibiting cyclooxygenase, an enzyme responsible for making prostaglandins which are mediators of inflammation. It has anti-inflammatory, fever-reducing, and pain-relieving properties. They are used to treat pain, fever, headaches, cramps, etc.