Agonists work by binding to receptors on the surface of cells. When an agonist binds to a receptor, it activates the receptor to produce a physiological response. This can include a variety of effects, such as pain relief, increased heart rate, or muscle relaxation, depending on the type of receptor and the location in the body.