After you are caught by a guard for committing a crime, all your inventory will be confiscated by the guards, and you will be taken to a jail cell. You can either serve your sentence by waiting in your cell or break out using a lockpick. However, you will only have one lockpick, so be careful or save before attempting to break out.