“A griefer is a player in a multiplayer video game who deliberately irritates and angers other players within the game, often using aspects of the game in unintended ways. A griefer derives pleasure primarily or exclusively from the act of annoying other users, and as such is a particular nuisance in online gaming communities, since griefers often cannot be deterred by penalties related to in-game goals.” Wikipedia
Sooner or later in your SL experience, you’re going to run into a griefer (often called “trolls” in SL). I’ve always found the best way to deal with them is to simply ignore them. If they get too annoying, you can also Block them or, in extreme cases, Block and Derender them.
But sometimes their actions can take the form of a direct attack on your avatar, such as locking it in a cage, pelting it with objects, etc. The immediate solution to this is simply to log off; when you log back in, your avatar will have been “reset;” that is, whatever was happening to you will no longer be happening.
But the ultimate solution is to file an abuse report. Griefing is a violation of SL’s Terms of Service, or TOS. But unless Linden Labs knows about the griefer, it can’t do anything about them. There’s an entire article detailing how and when to file an abuse report.
Griefers are a sad fact of life in SL. Knowing how to deal with them will keep your in-world experiences pleasant.