NSAIDs, such as ibuprofen and naproxen, are often used to alleviate pain and inflammation associated with menstrual cramps (dysmenorrhea), endometriosis, and other gynecological conditions. They work by inhibiting the production of prostaglandins, which cause pain and inflammation.