Detention is a form of punishment or disciplinary action in which a person, typically a student, is required to stay after school or during a designated time period to complete assigned tasks or reflect on their behavior. It is often used as a consequence for breaking school rules or misbehaving.