To flagellate is to hit or beat, especially with a whip. These days, in most parts of the world, people rarely flagellate others as a punishment.
While the verb flagellate can be used for any variety of whipping or beating, it often means a kind of religious self-punishment. This practice, while not common today, exists among some groups of Catholics who hit their own shoulders and backs as part of religious discipline. Flagellate comes from the noun flagellum, "a slender, thread-like structure," or in Latin, "whip."