Celecoxib is a selective COX-2 inhibitor that reduces inflammation and pain by blocking the cyclooxygenase-2 enzyme, which is responsible for the formation of prostaglandins involved in inflammatory processes. It is primarily used to treat conditions like osteoarthritis, rheumatoid arthritis, and acute pain.