Anti-inflammatory/pain relief medication is most often used for the short-term treatment of moderate to severe pain. It works by blocking your body's production of certain natural substances that cause inflammation which helps decrease swelling, pain, or fever