The red blood cells inside the capillary release their oxygen which passes through the wall and into the surrounding tissue. The tissue releases its waste products, like carbon dioxide, which passes through the wall and into the red blood cells. Arteries and veins run parallel throughout the body with a web-like network of capillaries, embedded in tissue, connecting them. The arteries pass their oxygen-rich blood to the capillaries which allow the exchange of gases within the tissue. The capillaries then pass their waste-rich blood to the veins for transport back to the heart.
Capillaries are also involved in the body's release of excess heat.
During exercise, for example, your body and blood temperature rises. To help release this excess heat, the blood delivers the heat to the capillaries which then rapidly release it to the tissue. The result is that your skin takes on a flushed, red appearance. If you hold your hand, for example, under hot water, your hand will quickly turn red for the same reason. Your arm, however, is not likely to change color because it is not actually feeling an increase in temperature.