There are many different forms of punishment, but they are not all interchangeable. Some are morally better than others, some are only viable in certain situations, some turn criminals into a further drag on society while others force them to make restitution for their crimes, etc. Here are all the major ones I could think of.

  • Physical pain. A near-ideal method in theory because enduring pain constitutes a virtue, and thus bad people fear it more than good people. Punishing someone with pain is like directly punishing the evil in them – the exact opposite of what imprisonment does (see below). However, this can only be applied to people that are physically near the punisher, and even then is not always a feasible option.
  • Destruction/theft of property. Generally causes emotional or psychological suffering, depending on what you take/destroy. This is not as ideal as physical pain, but still a pretty good method most of the time. Can be feasible in some situations that physical pain is not (and vice versa). In the case of theft, also has the significant upside of being able to donate the lost property to a worthy cause.
  • Ostracism. This one only really works for small crimes, just due to its inherent magnitude limitation (merely refusing to do business with someone is hardly a sufficient punishment for a crime such as rape or murder). Additionally it has the drawback of generally hurting the punisher as much as the punished, because in a free society all business would be voluntary anyway and so you probably wouldn’t have been doing it with them in the first place if you didn’t see it as beneficial to yourself. However, this is an option in nearly all cases, since it doesn’t require an advantage in physical force or anything like physical pain generally does, nor does it require direct physical proximity – anyone who is involved with the punisher in any way can be a target for ostracism. This method therefore is far from ideal but certainly has its uses.
  • imprisonment. The worst one by far. See my article on it for details. In short, the will to freedom is a virtue, and so when you punish someone by taking their freedom it’s like you’re punishing the little good there is in them.
  • Death. While somewhat questionable because we do not know for sure what happens to people when they die, death is often the most practical one for the present world, provided the magnitude of the crime is sufficient to warrant it. The reason is that most good people in this world are not in positions of power, and thus something like forced labor is usually out of the question. Additionally, death is often the only viable option against an offender who is actively fighting the punisher – there’s a reason governments use it so much during wartime even though normally imprisonment is their favorite.
  • Forced labor. The opposite of imprisonment in at least one way, as it turns criminals into productive members of society instead of a drag on the innocent. Since diligence is a virtue, this is similar to physical pain in the sense that it is like directly punishing the evil in someone.
  • Exile. This one is impractical in a lot of situations, because it requires controlled borders. Now in a small isolated village this might be workable, but in the present world it really isn’t because governments control the borders of nearly every domain. (It could still be viable if for example, a parent seeks to punish their child by kicking them out of the house.) It also – depending on the crime – can be inconsiderate of one’s neighbors because if you take, say, someone who steals because they don’t want to do an honest day’s work, and banish them from your town, they’re just going to go steal from someone else. Finally, even in a situations where it is both feasible and appropriate, you’re likely cutting the person off from their job (which hurts society), not to mention the high degree of collateral damage to their loved ones (as compared with something like physical pain or forced labor). But for all these issues, it’s still universally superior to imprisonment.