NSAIDs are frequently used to manage pain and inflammation associated with gynecological conditions like dysmenorrhea (painful periods) and endometriosis. They work by inhibiting the action of enzymes that produce prostaglandins, which are responsible for pain and inflammation.