As a noun: Confinement refers to the state of being imprisoned, restricted, or kept in a closed space.
Example: "The prisoners endured years of confinement."
As a verb: Confinement means to restrict or imprison someone or something.
Example: "They confined the suspect to a cell."
The specific part of speech depends on how it's used in the sentence.