In a liberal democracy or any state, actions that are harmful to others are illegal. So killing is illegal; it is a crime because it harms others. So is stealing a crime because it harms others. But what about actions of an agent that do not harm other people?
Many of the actions that are not harmful to others are not considered a crime even if it is harmful to the self. This is because liberty is an important category for a liberal democracy. So many of our actions are not considered illegal even when they may be deemed immoral or unhealthy. For example, smoking is injurious to health. There is no dispute with this fact. Yet, in a liberal democracy, smoking would not be considered a crime. This is so because the person's liberty trumps over the potential injury smoking may cause to the agent. Many people in the society would also consider watching of pornography or consensual sex outside of marriage immoral. But again these won't be consider illegal because the liberty/freedom of the agent trumps over certain other people's idea of morality. However, there are certain actions that may be consensual or is chosen by the agent for herself/himself and yet is illegal or must be considered a crime. What are some of those actions?
Consensual cannibalism is an example when an action is consensual and yet is considered a crime. There is a story of a person who offered himself to be eaten when someone sent out an invitation to eat a human being. The two agree that it was consensual and there is no coercion involved at all. Yet, the cannibal was arrested. You can google or read the story here: Victim of cannibal agreed to be eaten | World news | The Guardian.
Pedophilic action is another consensual action that deserves criminalization.
On a slightly different note -- because here it is not about two individuals choices, but an action chosen by an agent for herself -- one may impose some form of punitive measure for driving without helmet or seatbelt. Here, the agent may not harm anyone just by driving on the road without wearing helmet or a seatbelt. Even if there was an accident, it may harm the agent iherelf, not anyone else. Yet, punitive measure for not wearing seatbelt or helmet is fair.