Glucocorticoids work by binding to glucocorticoid receptors in the body, leading to changes in gene expression that decrease the production of inflammatory mediators. This action reduces inflammation and suppresses the immune system, making glucocorticoids effective in treating conditions like asthma, rheumatoid arthritis, and inflammatory bowel disease.