A kyosaku, traditionally, is an attempt by one's sensei to alert one to his/her mindlessness in zazen (sitting meditation), usually administered by a stick.

In a more colloquial fashion, a kyosaku is like a "reality-check," or something that alerts one to further contemplate their situation, in order to understand and work things out.

Kyosaku sticks generally occur only in Zen Buddhism, not in the other schools such as Theravada, Mahayana or Nichiren (to name only a few).

And kyosaku is always administered at the humble request of the student, by way of bowing one's head and putting the palms together, and then exposing each shoulder to be struck in turn. So, it is not really a punishment, but a self-administration-by-proxy, as it were.

Kyosaku means "the stick of compassion," in Japanese, although I'm not certain that's a direct translation.