Alex used a profanity at school one day.
Alex hated it, and learned not to use those words again.
The teacher made him stay after school as punishment.
The teacher made him apologize after class as punishment.