Ibuprofen blocks the enzyme cyclooxygenase (COX), which is involved in the synthesis of prostaglandins. Prostaglandins are lipid compounds that play a key role in inflammation and pain. By inhibiting COX, ibuprofen reduces the levels of prostaglandins, thereby alleviating pain and inflammation.