Coffee beans are soaked water to dissolve caffeine, which is then extracted by either solvents or charcoal, then beans are resoaked in the decaffeinated water to restore flavor.
Caffeine is removed by soaking the beans in hot water, then passing the fluid through carbon filters. The water is returned to the beans to regain flavors and oils.